From 49b943474c4ac39ee5f0f2e900fddd1253a84366 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 5 Aug 2015 04:04:49 +0200 Subject: 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. --- smdirwatcher.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'smdirwatcher.cpp') 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){ -- cgit v1.2.3-70-g09d2