aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-16 11:34:22 -0500
committerKen Moore <ken@ixsystems.com>2017-01-16 11:34:22 -0500
commit5771bb56f8dbdbbf14ff5f5e59578eef88204b29 (patch)
tree3d8479aeff41e65611cd7d0d2d77d4d4feb0601c
parentAdd support to lumina-config to show all applications which register themselv... (diff)
downloadlumina-5771bb56f8dbdbbf14ff5f5e59578eef88204b29.tar.gz
lumina-5771bb56f8dbdbbf14ff5f5e59578eef88204b29.tar.bz2
lumina-5771bb56f8dbdbbf14ff5f5e59578eef88204b29.zip
Adjust the browser backend a bit so only image files and *.desktop files are loaded within a separate thread. This seems to make no speed difference on my system, but should help prevent slowdowns on systems with a lower limit on the number of concurrent threads which can be run.
-rw-r--r--src-qt5/desktop-utils/lumina-fm/Browser.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp
index 5b84e2e7..9aeb70ac 100644
--- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp
@@ -41,7 +41,7 @@ bool Browser::showingHiddenFiles(){
// PRIVATE
void Browser::loadItem(QString info){
//qDebug() << "LoadItem:" << info;
- ////FileItem item;
+ //FileItem item;
//itemame = info;
QByteArray bytes;
if(imageFormats.contains(info.section(".",-1).toLower()) ){
@@ -61,8 +61,7 @@ void Browser::loadItem(QString info){
}
if(item.icon.isNull()){ item.icon = LXDG::findIcon(item.info.mimetype(), "unknown"); }*/
//qDebug() << " - done with item:" << info;
- emit threadDone(info, bytes);
- //return item;
+ this->emit threadDone(info, bytes);
}
// PRIVATE SLOTS
@@ -117,15 +116,21 @@ void Browser::loadDirectory(QString dir){
if(showHidden){ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot, QDir::NoSort); }
else{ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::NoSort); }
emit itemsLoading(files.length());
- QCoreApplication::processEvents();
+ //QCoreApplication::processEvents();
+ //QCoreApplication::sendPostedEvents();
for(int i=0; i<files.length(); i++){
watcher->addPath(directory.absoluteFilePath(files[i]));
//qDebug() << "Future Starting:" << files[i];
QString path = directory.absoluteFilePath(files[i]);
if(old.contains(path)){ old.removeAll(path); }
oldFiles << path; //add to list for next time
- QtConcurrent::run(this, &Browser::loadItem, path );
- QCoreApplication::sendPostedEvents();
+ if(imageFormats.contains(path.section(".",-1).toLower()) || path.endsWith(".desktop")){
+ QtConcurrent::run(this, &Browser::loadItem, path );
+ //QCoreApplication::sendPostedEvents();
+ }else{
+ //No special icon loading - do it in-line here
+ loadItem(path);
+ }
}
watcher->addPath(directory.absolutePath());
if(!old.isEmpty()){
bgstack15