summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemwatcher_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher_win.cpp')
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index cdb79e7c97..9e43d11e71 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -308,7 +308,7 @@ void QWindowsRemovableDriveListener::addPath(const QString &p)
notify.dbch_size = sizeof(notify);
notify.dbch_devicetype = DBT_DEVTYP_HANDLE;
notify.dbch_handle = volumeHandle;
- QEventDispatcherWin32 *winEventDispatcher = static_cast<QEventDispatcherWin32 *>(QCoreApplication::eventDispatcher());
+ QEventDispatcherWin32 *winEventDispatcher = static_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
re.devNotify = RegisterDeviceNotification(winEventDispatcher->internalHwnd(),
&notify, DEVICE_NOTIFY_WINDOW_HANDLE);
// Empirically found: The notifications also work when the handle is immediately
@@ -336,7 +336,7 @@ QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject *parent
: QFileSystemWatcherEngine(parent)
{
#ifndef Q_OS_WINRT
- if (QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher()) {
+ if (QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance()) {
m_driveListener = new QWindowsRemovableDriveListener(this);
eventDispatcher->installNativeEventFilter(m_driveListener);
parent->setProperty("_q_driveListener",