Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kded/kded.cpp
Show All 18 Lines | |||||
19 | #include "kded.h" | 19 | #include "kded.h" | ||
20 | 20 | | |||
21 | #include <QDebug> | 21 | #include <QDebug> | ||
22 | #include <QDBusConnection> | 22 | #include <QDBusConnection> | ||
23 | #include <QDBusMessage> | 23 | #include <QDBusMessage> | ||
24 | #include <QDBusConnectionInterface> | 24 | #include <QDBusConnectionInterface> | ||
25 | #include <KNotification> | 25 | #include <KNotification> | ||
26 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
27 | #include <KPluginFactory> | ||||
27 | 28 | | |||
28 | #include "plugins.h" | | |||
29 | #include "kdedactions.h" | 29 | #include "kdedactions.h" | ||
30 | 30 | | |||
31 | K_PLUGIN_FACTORY_WITH_JSON(TouchpadDisablerFactory, | ||||
32 | "kded_touchpad.json", | ||||
33 | registerPlugin<TouchpadDisabler>();) | ||||
34 | | ||||
31 | bool TouchpadDisabler::workingTouchpadFound() const | 35 | bool TouchpadDisabler::workingTouchpadFound() const | ||
32 | { | 36 | { | ||
33 | return m_workingTouchpadFound; | 37 | return m_workingTouchpadFound; | ||
34 | } | 38 | } | ||
35 | 39 | | |||
36 | void TouchpadDisabler::serviceRegistered(const QString &service) | 40 | void TouchpadDisabler::serviceRegistered(const QString &service) | ||
37 | { | 41 | { | ||
38 | if (!m_dependecies.removeWatchedService(service)) { | 42 | if (!m_dependecies.removeWatchedService(service)) { | ||
Show All 27 Lines | 69 | connect(m_backend, SIGNAL(touchpadStateChanged()), | |||
66 | SLOT(updateCurrentState())); | 70 | SLOT(updateCurrentState())); | ||
67 | 71 | | |||
68 | connect(m_backend, SIGNAL(touchpadReset()), SLOT(handleReset())); | 72 | connect(m_backend, SIGNAL(touchpadReset()), SLOT(handleReset())); | ||
69 | 73 | | |||
70 | m_keyboardActivityTimeout.setSingleShot(true); | 74 | m_keyboardActivityTimeout.setSingleShot(true); | ||
71 | connect(&m_keyboardActivityTimeout, SIGNAL(timeout()), | 75 | connect(&m_keyboardActivityTimeout, SIGNAL(timeout()), | ||
72 | SLOT(timerElapsed())); | 76 | SLOT(timerElapsed())); | ||
73 | 77 | | |||
78 | | ||||
74 | updateCurrentState(); | 79 | updateCurrentState(); | ||
75 | m_userRequestedState = m_touchpadEnabled; | 80 | m_userRequestedState = m_touchpadEnabled; | ||
76 | reloadSettings(); | 81 | reloadSettings(); | ||
77 | 82 | | |||
78 | m_dependecies.setWatchMode(QDBusServiceWatcher::WatchForRegistration); | 83 | m_dependecies.setWatchMode(QDBusServiceWatcher::WatchForRegistration); | ||
79 | m_dependecies.setConnection(QDBusConnection::sessionBus()); | 84 | m_dependecies.setConnection(QDBusConnection::sessionBus()); | ||
80 | QDBusPendingCall async = QDBusConnection::sessionBus().interface()->asyncCall(QLatin1String("ListNames")); | 85 | QDBusPendingCall async = QDBusConnection::sessionBus().interface()->asyncCall(QLatin1String("ListNames")); | ||
81 | QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(async, this); | 86 | QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(async, this); | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 298 | QDBusMessage msg = QDBusMessage::createMethodCall( | |||
296 | QStringLiteral("org.kde.osdService"), | 301 | QStringLiteral("org.kde.osdService"), | ||
297 | QStringLiteral("touchpadEnabledChanged") | 302 | QStringLiteral("touchpadEnabledChanged") | ||
298 | ); | 303 | ); | ||
299 | 304 | | |||
300 | msg.setArguments({m_backend->isTouchpadEnabled()}); | 305 | msg.setArguments({m_backend->isTouchpadEnabled()}); | ||
301 | 306 | | |||
302 | QDBusConnection::sessionBus().asyncCall(msg); | 307 | QDBusConnection::sessionBus().asyncCall(msg); | ||
303 | } | 308 | } | ||
309 | | ||||
310 | #include "kded.moc" |