on xenial help sign in
better
commit15ec470044af48020465d63d62659b9faadcb090 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 10 Apr 2015, 11:22 (12 years ago) parentb4e9db7
3 files changed+14−13
plugins/AccountsService/AccountsService.cpp+9−9 plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+4−3 plugins/AccountsService/AccountsServiceDBusAdaptor.h+1−1
plugins/AccountsService/AccountsService.cpp+9−9
@@ -126,7 +126,7 @@ bool AccountsService::hereLicensePathValid() const
126126
127127void AccountsService::updateDemoEdges(bool async)
128128{
129− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.canonical.unity.AccountsService", "demo-edges");
129+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.canonical.unity.AccountsService", "demo-edges");
130130 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
131131
132132 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -151,7 +151,7 @@ void AccountsService::updateDemoEdges(bool async)
151151
152152void AccountsService::updateEnableLauncherWhileLocked(bool async)
153153{
154− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableLauncherWhileLocked");
154+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableLauncherWhileLocked");
155155 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
156156
157157 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -176,7 +176,7 @@ void AccountsService::updateEnableLauncherWhileLocked(bool async)
176176
177177void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
178178{
179− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableIndicatorsWhileLocked");
179+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableIndicatorsWhileLocked");
180180 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
181181
182182 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -201,7 +201,7 @@ void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
201201
202202void AccountsService::updateBackgroundFile(bool async)
203203{
204− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "org.freedesktop.Accounts.User", "BackgroundFile");
204+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "org.freedesktop.Accounts.User", "BackgroundFile");
205205 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
206206
207207 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -226,7 +226,7 @@ void AccountsService::updateBackgroundFile(bool async)
226226
227227void AccountsService::updateStatsWelcomeScreen(bool async)
228228{
229− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.touch.AccountsService.SecurityPrivacy", "StatsWelcomeScreen");
229+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.touch.AccountsService.SecurityPrivacy", "StatsWelcomeScreen");
230230 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
231231
232232 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -251,7 +251,7 @@ void AccountsService::updateStatsWelcomeScreen(bool async)
251251
252252void AccountsService::updatePasswordDisplayHint(bool async)
253253{
254− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.touch.AccountsService.SecurityPrivacy", "StatsWelcomeScreen");
254+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.touch.AccountsService.SecurityPrivacy", "StatsWelcomeScreen");
255255 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
256256
257257 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -276,7 +276,7 @@ void AccountsService::updatePasswordDisplayHint(bool async)
276276
277277void AccountsService::updateFailedLogins(bool async)
278278{
279− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins");
279+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins");
280280 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
281281
282282 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -301,7 +301,7 @@ void AccountsService::updateFailedLogins(bool async)
301301
302302void AccountsService::updateHereEnabled(bool async)
303303{
304− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted");
304+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted");
305305 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
306306
307307 connect(watcher, &QDBusPendingCallWatcher::finished,
@@ -326,7 +326,7 @@ void AccountsService::updateHereEnabled(bool async)
326326
327327void AccountsService::updateHereLicensePath(bool async)
328328{
329− QDBusPendingReply<QDBusVariant> pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseBasePath");
329+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseBasePath");
330330 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
331331
332332 connect(watcher, &QDBusPendingCallWatcher::finished,
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+4−3
@@ -55,7 +55,7 @@ QDBusPendingReply<QDBusVariant> AccountsServiceDBusAdaptor::getUserPropertyAsync
5555 if (iface != nullptr && iface->isValid()) {
5656 return iface->asyncCall("Get", interface, property);
5757 }
58− return QDBusPendingReply<QVariant>();
58+ return QDBusPendingReply<QVariant>(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
5959}
6060
6161void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
@@ -67,13 +67,14 @@ void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QStr
6767 }
6868}
6969
70−void AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value)
70+QDBusPendingCall AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value)
7171{
7272 QDBusInterface *iface = getUserInterface(user);
7373 if (iface != nullptr && iface->isValid()) {
7474 // The value needs to be carefully wrapped
75− iface->asyncCall("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
75+ return iface->asyncCall("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
7676 }
77+ return QDBusPendingCall::fromCompletedCall(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
7778}
7879
7980void AccountsServiceDBusAdaptor::propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
plugins/AccountsService/AccountsServiceDBusAdaptor.h+1−1
@@ -47,7 +47,7 @@ public:
4747 }
4848
4949 Q_INVOKABLE void setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value);
50− Q_INVOKABLE void setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
50+ Q_INVOKABLE QDBusPendingCall setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
5151
5252Q_SIGNALS:
5353 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);