diff options
author | Arno <am@disconnect.de> | 2014-12-10 23:19:09 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-12-10 23:19:09 +0100 |
commit | d0a7a182617e8353d78274832f515c6fad5d04e4 (patch) | |
tree | 0b6f4ca017bbcf2c20b44874d904515523b94f03 /smdirwatcher.cpp | |
parent | 2c022561f692a813b44da39d6ffdcb373aa4c7ba (diff) | |
download | SheMov-d0a7a182617e8353d78274832f515c6fad5d04e4.tar.gz SheMov-d0a7a182617e8353d78274832f515c6fad5d04e4.tar.bz2 SheMov-d0a7a182617e8353d78274832f515c6fad5d04e4.zip |
Don't show progressdialog when autorefreshing
They don't play nice together. Crap... AutoRefresh should be a thread,
but that opens another shebang of problems, I guess. So don't show the
dialog for now.
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r-- | smdirwatcher.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index 8c0570e..c5914ad 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -29,7 +29,7 @@ SmDirWatcher::SmDirWatcher(int numFields, QObject *parent) : QThread(parent), mF mDb.open(); } -void SmDirWatcher::setDir(const QString &dir){ +void SmDirWatcher::setDir(const QString &dir, bool progress){ if(mDescr){ inotify_rm_watch(mFd, mDescr); //generates IN_IGNORE ??? } @@ -37,14 +37,18 @@ void SmDirWatcher::setDir(const QString &dir){ QDir d(mCurrent); QWidget *fsWidget = SmGlobals::instance()->registeredWidgets().value("FSWidget"); QProgressDialog *pDlg = new QProgressDialog(tr("Gathering data..."), QString(), 0, d.count(), fsWidget); - pDlg->setWindowModality(Qt::WindowModal); - Helper::centerWidget(pDlg); - pDlg->show(); + if(progress){ + pDlg->setWindowModality(Qt::WindowModal); + Helper::centerWidget(pDlg); + pDlg->show(); + } SmTreeItem *rootItem = new SmTreeItem(mNumFields); for(uint i = 0; i < d.count(); ++i){ QFileInfo fi = d.entryInfoList().at(i); - pDlg->setValue(i); - qApp->processEvents(); + if(progress){ + pDlg->setValue(i); + qApp->processEvents(); + } if(fi.fileName() == "." || fi.fileName() == ".."){ continue; } |