summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-26 08:56:36 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-27 08:18:55 +0000
commit555a6b5d5d2dd91a0dcf9e3d5fbadd1b31bf80f3 (patch)
treee0faaad63a8dc4055807a72ecce89cf7dc0d1cb2 /src/plugins
parent5e64957ee4162ecf4456306a530a68761c2b127f (diff)
Modernize the "filesystemwatcher" feature
Change-Id: If030b56ad97e047d89d442629262b4839df306d4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp4
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 0e587965ca..3a54f33832 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -112,7 +112,7 @@ QIBusPlatformInputContext::QIBusPlatformInputContext ()
QString socketPath = QIBusPlatformInputContextPrivate::getSocketPath();
QFile file(socketPath);
if (file.open(QFile::ReadOnly)) {
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
qCDebug(qtQpaInputMethods) << "socketWatcher.addPath" << socketPath;
// If KDE session save is used or restart ibus-daemon,
// the applications could run before ibus-daemon runs.
@@ -564,7 +564,7 @@ void QIBusPlatformInputContext::connectToBus()
d->initBus();
connectToContextSignals();
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
if (!d->usePortal && m_socketWatcher.files().size() == 0)
m_socketWatcher.addPath(QIBusPlatformInputContextPrivate::getSocketPath());
#endif
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index f37552b937..d4daea2eb3 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -44,7 +44,9 @@
#include <QtCore/qpointer.h>
#include <QtCore/QLocale>
#include <QtDBus/qdbuspendingreply.h>
+#if QT_CONFIG(filesystemwatcher)
#include <QFileSystemWatcher>
+#endif
#include <QTimer>
#include <QWindow>
@@ -116,7 +118,7 @@ public Q_SLOTS:
private:
QIBusPlatformInputContextPrivate *d;
bool m_eventFilterUseSynchronousMode;
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
QFileSystemWatcher m_socketWatcher;
#endif
QTimer m_timer;