aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-11-15 10:28:13 -0500
committerKen Moore <ken@ixsystems.com>2017-11-15 10:28:13 -0500
commit55d00fe0de302191307fde6af8e1b291bf6c91a8 (patch)
tree3016e5dbbcf9a3cd2ae91a14e35a3061dd1cf487 /src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
parentFinish cleaning up the new LFileInfo class/file. (diff)
downloadlumina-55d00fe0de302191307fde6af8e1b291bf6c91a8.tar.gz
lumina-55d00fe0de302191307fde6af8e1b291bf6c91a8.tar.bz2
lumina-55d00fe0de302191307fde6af8e1b291bf6c91a8.zip
Ensure that the Browser backend is also contained in a background thread.
This prevents it from delaying the UI from updating.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
index 4d8ae44c..978992c1 100644
--- a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
@@ -19,9 +19,11 @@ BrowserWidget::BrowserWidget(QString objID, QWidget *parent) : QWidget(parent){
//Setup the Widget/UI
this->setLayout( new QVBoxLayout(this) );
ID = objID;
- //BROWSER = 0;
//Setup the backend browser object
- BROWSER = new Browser(this);
+ bThread = new QThread();
+ BROWSER = new Browser();
+ BROWSER->moveToThread(bThread);
+ bThread->start();
connect(BROWSER, SIGNAL(clearItems()), this, SLOT(clearItems()) );
connect(BROWSER, SIGNAL(itemRemoved(QString)), this, SLOT(itemRemoved(QString)) );
connect(BROWSER, SIGNAL(itemDataAvailable(QIcon, LFileInfo*)), this, SLOT(itemDataAvailable(QIcon, LFileInfo*)) );
@@ -37,14 +39,18 @@ BrowserWidget::BrowserWidget(QString objID, QWidget *parent) : QWidget(parent){
BrowserWidget::~BrowserWidget(){
BROWSER->deleteLater();
+ bThread->exit();
+ bThread->deleteLater();
}
void BrowserWidget::changeDirectory(QString dir){
- QStringList vids = videoMap.keys();
- for(int i=0; i<vids.length(); i++){ videoMap.take(vids[i]).second->deleteLater(); }
- //videoMap.clear();
+ if(USE_VIDEO_LABEL){
+ QStringList vids = videoMap.keys();
+ for(int i=0; i<vids.length(); i++){ videoMap.take(vids[i]).second->deleteLater(); }
+ //videoMap.clear();
+ }
if(BROWSER->currentDirectory()==dir){ return; } //already on this directory
- //qDebug() << "Change Directory:" << dir << historyList;
+ qDebug() << "Change Directory:" << dir << historyList;
if( !dir.contains("/.zfs/snapshot/") ){
if(historyList.isEmpty() || !dir.isEmpty()){ historyList << dir; }
@@ -281,7 +287,7 @@ void BrowserWidget::clearItems(){
if(listWidget!=0){ listWidget->clear(); }
else if(treeWidget!=0){ treeWidget->clear(); }
freshload = true;
- videoMap.clear();
+ //videoMap.clear();
}
void BrowserWidget::itemRemoved(QString item){
bgstack15