diff options
author | Arno <arno@disconnect.de> | 2015-08-05 04:04:49 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2015-08-05 04:18:09 +0200 |
commit | 49b943474c4ac39ee5f0f2e900fddd1253a84366 (patch) | |
tree | df68a1d2a09877b01c31d365acee7df44be9ccdd /smdirwatcher.cpp | |
parent | b3ccbde0d3e540453b80709002cae0630172f1dc (diff) | |
download | SheMov-49b943474c4ac39ee5f0f2e900fddd1253a84366.tar.gz SheMov-49b943474c4ac39ee5f0f2e900fddd1253a84366.tar.bz2 SheMov-49b943474c4ac39ee5f0f2e900fddd1253a84366.zip |
Remove progress dialog and use Qt::WaitCursor instead
Get rid of the progress Dialog in the filesystem widget and replace it
with Qt::WaitCursor. While at it, show the waitcursor in the picture
widget, too.
Also remove the annoying warnings from ImageMagick by defining the
missing constants.
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r-- | smdirwatcher.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index 8c0f04a..79bce7c 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -29,24 +29,16 @@ SmDirWatcher::SmDirWatcher(int numFields, QObject *parent) : QThread(parent), mF mDb.open(); } -void SmDirWatcher::setDir(const QString &dir, bool progress){ +void SmDirWatcher::setDir(const QString &dir){ if(mDescr){ inotify_rm_watch(mFd, mDescr); //generates IN_IGNORE ??? } mCurrent = dir; QDir d(mCurrent); - QWidget *fsWidget = SmGlobals::instance()->registeredWidgets().value("FSWidget"); - QProgressDialog *pDlg = new QProgressDialog(tr("Gathering data..."), QString(), 0, d.count(), fsWidget); - if(progress){ - pDlg->show(); - } + qApp->setOverrideCursor(Qt::WaitCursor); SmTreeItem *rootItem = new SmTreeItem(mNumFields); for(uint i = 0; i < d.count(); ++i){ QFileInfo fi = d.entryInfoList().at(i); - if(progress){ - pDlg->setValue(i); - qApp->processEvents(); - } if(fi.fileName() == "." || fi.fileName() == ".."){ continue; } @@ -54,7 +46,6 @@ void SmDirWatcher::setDir(const QString &dir, bool progress){ SmTreeItem *newItem = new SmTreeItem(data, rootItem); rootItem->appendChild(newItem); } - pDlg->deleteLater(); emit population(rootItem); /* mask rationale: * IN_DELETE_SELF cannot happen since we're only @@ -62,6 +53,7 @@ void SmDirWatcher::setDir(const QString &dir, bool progress){ * We don't care about the other events */ mDescr = inotify_add_watch(mFd, qPrintable(dir), IN_CLOSE_WRITE | IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVED_FROM | IN_MOVED_TO); + qApp->restoreOverrideCursor(); } void SmDirWatcher::setExpensiveOps(bool expensiveOps){ |