summaryrefslogtreecommitdiffstats
path: root/smdirwatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r--smdirwatcher.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp
index 2b03179..9c4fb81 100644
--- a/smdirwatcher.cpp
+++ b/smdirwatcher.cpp
@@ -103,7 +103,7 @@ void SmDirWatcher::stop(){
quit();
}
-SmDataColletor::SmDataColletor(const int numFields, QObject *parent) : QThread(parent), mSemFree(0), mSemUsed(0), mDataQueue(0), mNumFields(numFields), mCheckForPresent(true), mCancel(false) {
+SmDataColletor::SmDataColletor(const int numFields, QObject *parent) : QThread(parent), mSemFree(0), mSemUsed(0), mDataQueue(0), mNumFields(numFields), mCheckForPresent(true), mCancel(false), mShowProgress(false) {
QSqlDatabase db = QSqlDatabase::cloneDatabase(QSqlDatabase::database("treedb"), "collectordb");
db.open();
mPicPresentQ = new QSqlQuery(db);
@@ -154,9 +154,13 @@ void SmDataColletor::run(){
SmTreeItem * SmDataColletor::populate(const QString &dir){
SmTreeItem *retval = new SmTreeItem(mNumFields);
QDir d = QDir(dir);
- emit totalFiles(d.entryInfoList().size());
+ if(mShowProgress){
+ emit totalFiles(d.entryInfoList().size());
+ }
foreach(QFileInfo fi, d.entryInfoList()){
- emit progress();
+ if(mShowProgress){
+ emit progress();
+ }
if(fi.fileName() == "."){
continue;
}