Changeset View
Changeset View
Standalone View
Standalone View
interfaces/dbusinterfaces.h
Show All 31 Lines | |||||
32 | #include "interfaces/notificationinterface.h" | 32 | #include "interfaces/notificationinterface.h" | ||
33 | #include "interfaces/mprisremoteinterface.h" | 33 | #include "interfaces/mprisremoteinterface.h" | ||
34 | #include "interfaces/remotecontrolinterface.h" | 34 | #include "interfaces/remotecontrolinterface.h" | ||
35 | #include "interfaces/lockdeviceinterface.h" | 35 | #include "interfaces/lockdeviceinterface.h" | ||
36 | #include "interfaces/remotecommandsinterface.h" | 36 | #include "interfaces/remotecommandsinterface.h" | ||
37 | #include "interfaces/remotekeyboardinterface.h" | 37 | #include "interfaces/remotekeyboardinterface.h" | ||
38 | #include "interfaces/smsinterface.h" | 38 | #include "interfaces/smsinterface.h" | ||
39 | #include "interfaces/conversationsinterface.h" | 39 | #include "interfaces/conversationsinterface.h" | ||
40 | #include "interfaces/shareinterface.h" | ||||
40 | 41 | | |||
41 | /** | 42 | /** | ||
42 | * Using these "proxy" classes just in case we need to rename the | 43 | * Using these "proxy" classes just in case we need to rename the | ||
43 | * interface, so we can change the class name in a single place. | 44 | * interface, so we can change the class name in a single place. | ||
44 | */ | 45 | */ | ||
45 | class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface | 46 | class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface | ||
46 | : public OrgKdeKdeconnectDaemonInterface | 47 | : public OrgKdeKdeconnectDaemonInterface | ||
47 | { | 48 | { | ||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 214 | class KDECONNECTINTERFACES_EXPORT SmsDbusInterface | |||
214 | : public OrgKdeKdeconnectDeviceSmsInterface | 215 | : public OrgKdeKdeconnectDeviceSmsInterface | ||
215 | { | 216 | { | ||
216 | Q_OBJECT | 217 | Q_OBJECT | ||
217 | public: | 218 | public: | ||
218 | explicit SmsDbusInterface(const QString& deviceId, QObject* parent = nullptr); | 219 | explicit SmsDbusInterface(const QString& deviceId, QObject* parent = nullptr); | ||
219 | ~SmsDbusInterface() override; | 220 | ~SmsDbusInterface() override; | ||
220 | }; | 221 | }; | ||
221 | 222 | | |||
223 | class KDECONNECTINTERFACES_EXPORT ShareDbusInterface | ||||
224 | : public OrgKdeKdeconnectDeviceShareInterface | ||||
225 | { | ||||
226 | Q_OBJECT | ||||
227 | public: | ||||
228 | explicit ShareDbusInterface(const QString& deviceId, QObject* parent = nullptr); | ||||
229 | ~ShareDbusInterface() override; | ||||
230 | }; | ||||
231 | | ||||
222 | template <typename T, typename W> | 232 | template <typename T, typename W> | ||
223 | static void setWhenAvailable(const QDBusPendingReply<T>& pending, W func, QObject* parent) | 233 | static void setWhenAvailable(const QDBusPendingReply<T>& pending, W func, QObject* parent) | ||
224 | { | 234 | { | ||
225 | QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pending, parent); | 235 | QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pending, parent); | ||
226 | QObject::connect(watcher, &QDBusPendingCallWatcher::finished, | 236 | QObject::connect(watcher, &QDBusPendingCallWatcher::finished, | ||
227 | parent, [func](QDBusPendingCallWatcher* watcher) { | 237 | parent, [func](QDBusPendingCallWatcher* watcher) { | ||
228 | watcher->deleteLater(); | 238 | watcher->deleteLater(); | ||
229 | QDBusPendingReply<T> reply = *watcher; | 239 | QDBusPendingReply<T> reply = *watcher; | ||
230 | func(reply.value()); | 240 | func(reply.value()); | ||
231 | }); | 241 | }); | ||
232 | } | 242 | } | ||
233 | 243 | | |||
234 | #endif | 244 | #endif |