Changeset View
Changeset View
Standalone View
Standalone View
plugins/lockdevice/lockdeviceplugin.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 84 | if (!m_iface) { | |||
---|---|---|---|---|---|
85 | m_iface = new OrgFreedesktopScreenSaverInterface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/org/freedesktop/ScreenSaver"), QDBusConnection::sessionBus()); | 85 | m_iface = new OrgFreedesktopScreenSaverInterface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/org/freedesktop/ScreenSaver"), QDBusConnection::sessionBus()); | ||
86 | if(!m_iface->isValid()) | 86 | if(!m_iface->isValid()) | ||
87 | qCWarning(KDECONNECT_PLUGIN_LOCKREMOTE) << "Couldn't connect to the ScreenSaver interface"; | 87 | qCWarning(KDECONNECT_PLUGIN_LOCKREMOTE) << "Couldn't connect to the ScreenSaver interface"; | ||
88 | } | 88 | } | ||
89 | return m_iface; | 89 | return m_iface; | ||
90 | } | 90 | } | ||
91 | 91 | | |||
92 | void LockDevicePlugin::connected() | 92 | void LockDevicePlugin::connected() | ||
93 | { | 93 | { | ||
94 | QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents); | | |||
95 | | ||||
96 | NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST, {{"requestLocked", QVariant()}}); | 94 | NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST, {{"requestLocked", QVariant()}}); | ||
albertvaka: Why Properties instead of ExportScriptableInvokables? ring() should be able callable through… | |||||
97 | sendPackage(np); | 95 | sendPackage(np); | ||
98 | } | 96 | } | ||
99 | 97 | | |||
100 | QString LockDevicePlugin::dbusPath() const | 98 | QString LockDevicePlugin::dbusPath() const | ||
101 | { | 99 | { | ||
102 | return "/modules/kdeconnect/devices/" + device()->id() + "/lockdevice"; | 100 | return "/modules/kdeconnect/devices/" + device()->id() + "/lockdevice"; | ||
103 | } | 101 | } | ||
104 | 102 | | |||
105 | #include "lockdeviceplugin.moc" | 103 | #include "lockdeviceplugin.moc" |
Why Properties instead of ExportScriptableInvokables? ring() should be able callable through dbus.