aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lumina-fm/DirData.h2
-rw-r--r--lumina-fm/widgets/DirWidget.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/lumina-fm/DirData.h b/lumina-fm/DirData.h
index c82ee155..26cfb3ad 100644
--- a/lumina-fm/DirData.h
+++ b/lumina-fm/DirData.h
@@ -20,7 +20,7 @@
#define ZSNAPDIR QString("/.zfs/snapshot/")
-#define DEBUG 1
+#define DEBUG 0
//Class used for keeping track of directory information in the HASH
class LDirInfoList{
diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp
index 8d41d4c0..b4a6ca78 100644
--- a/lumina-fm/widgets/DirWidget.cpp
+++ b/lumina-fm/widgets/DirWidget.cpp
@@ -21,7 +21,9 @@
#include "../ScrollDialog.h"
+#ifndef DEBUG
#define DEBUG 0
+#endif
DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){
ui->setupUi(this); //load the designer file
@@ -236,6 +238,7 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){
if(lastbasedir != normalbasedir){
if(showDetails){ treeWidget->clear(); }
else{ listWidget->clear(); }
+ QApplication::processEvents(); //make sure it is cleared right away
}else{
//Need to be smarter about which items need to be removed
// - compare the old/new lists and remove any items not in the new listing (new items taken care of below)
@@ -248,7 +251,7 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){
i--;
}
}
- QApplication::processEvents();
+ QApplication::processEvents(); //make sure the scrollbar is up to date after removals
scrollpercent = treeWidget->verticalScrollBar()->value()/( (double) treeWidget->verticalScrollBar()->maximum());
}else{
for(int i=0; i<listWidget->count(); i++){
@@ -257,6 +260,7 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){
i--;
}
}
+ QApplication::processEvents(); //make sure the scrollbar is up to date after removals
scrollpercent = listWidget->horizontalScrollBar()->value()/( (double) listWidget->horizontalScrollBar()->maximum());
}
} //end check for CDIR reload
@@ -350,7 +354,7 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){
listWidget->scrollToItem(it);
}
}
- if(i%10==0){ QApplication::processEvents(); }//keep the UI snappy while loading a directory
+ if(i%20==0){ QApplication::processEvents(); }//keep the UI snappy while loading a directory
if(DEBUG){ qDebug() << " - item finished:" << i << time.elapsed(); }
}
if(DEBUG){ qDebug() << "Done with item loop:" << time.elapsed() << list.length(); }
bgstack15