summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfileinfogatherer_p.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-15 15:32:45 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-26 11:36:30 +0000
commit0901d4290f6e7f0d1650b14fc085ecde7fb595ff (patch)
treec5b2f4a8c692682a03bbd63fc69fc68a2f5b2ade /src/widgets/dialogs/qfileinfogatherer_p.h
parentf55c73ede28d4455f555a28e401407326ac9b954 (diff)
QFileSystemModel/Win: Fix file system operations failing due to watchers
File system operations like renaming/removing may fail on Windows when file system watchers are present. Add functions to QFileSystemModelPrivate to temporarily remove the watchers prior to such operations and to restore them in case of failure. Use them for rename/remove (within a feature check for QFileSystemWatcher and Q_OS_WIN). Task-number: QTBUG-65683 Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/dialogs/qfileinfogatherer_p.h')
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index bb13d4eb01..cc82f42850 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -167,6 +167,13 @@ public:
explicit QFileInfoGatherer(QObject *parent = 0);
~QFileInfoGatherer();
+#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
+ QStringList watchedFiles() const { return watcher->files(); }
+ QStringList watchedDirectories() const { return watcher->directories(); }
+ void watchPaths(const QStringList &paths) { watcher->addPaths(paths); }
+ void unwatchPaths(const QStringList &paths) { watcher->removePaths(paths); }
+#endif // filesystemwatcher && Q_OS_WIN
+
// only callable from this->thread():
void clear();
void removePath(const QString &path);