diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-24 11:15:16 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-18 07:52:22 +0000 |
commit | 45580aa92557caa4f3f5be783573ddb80602e494 (patch) | |
tree | 31abaac0c77ae0588e65b56ea7f2c401492bb4d4 /src/corelib/io/qfilesystemwatcher_p.h | |
parent | ae6681673eb5c7768070cad61f483d2a5405dc9e (diff) |
QFileSystemWatcher/Win32: Listen for WM_DEVICECHANGE
Add a class QWindowsRemovableDriveListener to
QWindowsFileSystemWatcherEngine listening to the WM_DEVICECHANGE messages
sent to the top level windows to detect insertion and removal of USB drives.
In addition, hook into QWindowsFileSystemWatcherEngine::addPaths() when
watching on removable drives, registering a notification for a
volume-lock-for-removal message on the internal window handle obtained from
QEventDispatcherWin32. When a request to lock the volume for removal is
received, remove the paths from the watcher, enabling removal.
The class instance is set as a dynamic property on the QFileSystemWatcher where
it can be retrieved from clients. This is primarily intended for use by
QFileInfoGatherer/QFileSystemModel.
Task-number: QTBUG-14290
Task-number: QTBUG-18729
Task-number: QTBUG-55459
Change-Id: Ic95b9d9291b1ec6f426c0702bad896bb064b9346
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher_p.h')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_p.h b/src/corelib/io/qfilesystemwatcher_p.h index 6c64411f92..4220c1db28 100644 --- a/src/corelib/io/qfilesystemwatcher_p.h +++ b/src/corelib/io/qfilesystemwatcher_p.h @@ -58,6 +58,7 @@ #include <private/qobject_p.h> #include <QtCore/qstringlist.h> +#include <QtCore/qhash.h> QT_BEGIN_NAMESPACE @@ -106,6 +107,15 @@ public: // private slots void _q_fileChanged(const QString &path, bool removed); void _q_directoryChanged(const QString &path, bool removed); + +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) + void _q_winDriveLockForRemoval(const QString &); + void _q_winDriveLockForRemovalFailed(const QString &); + void _q_winDriveRemoved(const QString &); + +private: + QHash<QChar, QStringList> temporarilyRemovedPaths; +#endif // Q_OS_WIN && !Q_OS_WINRT }; |