diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-15 15:32:45 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-26 11:36:30 +0000 |
commit | 0901d4290f6e7f0d1650b14fc085ecde7fb595ff (patch) | |
tree | c5b2f4a8c692682a03bbd63fc69fc68a2f5b2ade /src/widgets/dialogs/qfilesystemmodel_p.h | |
parent | f55c73ede28d4455f555a28e401407326ac9b954 (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/qfilesystemmodel_p.h')
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel_p.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index e8bae4f659..a2a02e2d41 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -297,9 +297,13 @@ public: static int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs); QDir rootDir; -#ifndef QT_NO_FILESYSTEMWATCHER +#if QT_CONFIG(filesystemwatcher) +# ifdef Q_OS_WIN + QStringList unwatchPathsAt(const QModelIndex &); + void watchPaths(const QStringList &paths) { fileInfoGatherer.watchPaths(paths); } +# endif // Q_OS_WIN QFileInfoGatherer fileInfoGatherer; -#endif +#endif // filesystemwatcher QTimer delayedSortTimer; bool forceSort; int sortColumn; |