diff options
author | Ken Moore <ken@ixsystems.com> | 2017-05-26 18:15:19 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-05-26 18:15:19 -0400 |
commit | b965b3af0f375e314904dd7a64895ac154a869a0 (patch) | |
tree | 5bf3e6bf11817bf29ad72143400955add7790028 /src-qt5/desktop-utils/lumina-fm | |
parent | Adjust a couple size measurements so they work better across both normal and ... (diff) | |
download | lumina-b965b3af0f375e314904dd7a64895ac154a869a0.tar.gz lumina-b965b3af0f375e314904dd7a64895ac154a869a0.tar.bz2 lumina-b965b3af0f375e314904dd7a64895ac154a869a0.zip |
Cleanup how the QtConcurrent thread is run in the Browser class a bit - no real difference, just more formally-correct.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/Browser.cpp | 12 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/Browser.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp index d3e1b453..2fb7c533 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp +++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp @@ -39,7 +39,7 @@ bool Browser::showingHiddenFiles(){ } // PRIVATE -void Browser::loadItem(QString info){ +void Browser::loadItem(QString info, Browser *obj){ //qDebug() << "LoadItem:" << info; //FileItem item; //itemame = info; @@ -58,7 +58,7 @@ void Browser::loadItem(QString info){ }*/ } //qDebug() << " - done with item:" << info; - this->emit threadDone(info, bytes); + obj->emit threadDone(info, bytes); } QIcon Browser::loadIcon(QString icon){ @@ -73,14 +73,14 @@ QIcon Browser::loadIcon(QString icon){ // PRIVATE SLOTS void Browser::fileChanged(QString file){ if(file.startsWith(currentDir+"/") ){ - if(QFile::exists(file) ){ QtConcurrent::run(this, &Browser::loadItem, file ); } //file modified but not removed + if(QFile::exists(file) ){ QtConcurrent::run(this, &Browser::loadItem, file, this); } //file modified but not removed else{ QTimer::singleShot(0, this, SLOT(loadDirectory()) ); } //file removed - need to update entire dir }else if(file==currentDir){ QTimer::singleShot(0, this, SLOT(loadDirectory()) ); } } void Browser::dirChanged(QString dir){ if(dir==currentDir){ QTimer::singleShot(500, this, SLOT(loadDirectory()) ); } - else if(dir.startsWith(currentDir)){ QtConcurrent::run(this, &Browser::loadItem, dir ); } + else if(dir.startsWith(currentDir)){ QtConcurrent::run(this, &Browser::loadItem, dir, this ); } } void Browser::futureFinished(QString name, QByteArray icon){ @@ -133,11 +133,11 @@ void Browser::loadDirectory(QString dir){ if(old.contains(path)){ old.removeAll(path); } oldFiles << path; //add to list for next time if(imageFormats.contains(path.section(".",-1).toLower()) || path.endsWith(".desktop")){ - QtConcurrent::run(this, &Browser::loadItem, path ); + QtConcurrent::run(this, &Browser::loadItem, path, this); //QCoreApplication::sendPostedEvents(); }else{ //No special icon loading - do it in-line here - loadItem(path); + loadItem(path, this); } } watcher->addPath(directory.absolutePath()); diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.h b/src-qt5/desktop-utils/lumina-fm/Browser.h index c4641277..b5c7c038 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.h +++ b/src-qt5/desktop-utils/lumina-fm/Browser.h @@ -45,7 +45,7 @@ private: QHash<QString, QIcon> mimeIcons; //cache for quickly re-using QIcons - void loadItem(QString info); //this is the main loader class - multiple instances each run in a separate thread + void loadItem(QString info, Browser *obj); //this is the main loader class - multiple instances each run in a separate thread QIcon loadIcon(QString icon); //simplification for using/populating the mimIcons cache private slots: |