From 2cc92200386c55818cbe9bcb7d2e488170317d70 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 28 Aug 2013 11:10:58 +0200 Subject: Don't show progress dialog when we're polling --- smdirwatcher.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'smdirwatcher.cpp') 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; } -- cgit v1.2.3-70-g09d2