diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/dialogs/qfileinfogatherer.cpp | 13 | ||||
-rw-r--r-- | src/gui/dialogs/qfileinfogatherer_p.h | 1 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 06c9f39..315b931 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -170,6 +170,7 @@ void QFileInfoGatherer::updateFile(const QString &filePath) void QFileInfoGatherer::clear() { #ifndef QT_NO_FILESYSTEMWATCHER + QMutexLocker locker(&mutex); watcher->removePaths(watcher->files()); watcher->removePaths(watcher->directories()); #endif @@ -183,18 +184,11 @@ void QFileInfoGatherer::clear() void QFileInfoGatherer::removePath(const QString &path) { #ifndef QT_NO_FILESYSTEMWATCHER + QMutexLocker locker(&mutex); watcher->removePath(path); #endif } -void QFileInfoGatherer::addPath(const QString &path) -{ -#ifndef QT_NO_FILESYSTEMWATCHER - if (!watcher->directories().contains(path)) - watcher->addPath(path); -#endif -} - /* List all files in \a directoryPath @@ -286,9 +280,10 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil { #ifndef QT_NO_FILESYSTEMWATCHER if (files.isEmpty() + && !watcher->directories().contains(path) && !path.isEmpty() && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { - QMetaObject::invokeMethod(this, "addPath", Q_ARG(QString, path)); + watcher->addPath(path); } #endif diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index bff4f69..98217c1 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -162,7 +162,6 @@ public: void clear(); void removePath(const QString &path); - Q_INVOKABLE void addPath(const QString& path); QExtendedInformation getInfo(const QFileInfo &info) const; public Q_SLOTS: |