diff options
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){ |