Merge lp:~nick-dedekind/unity8/1436982.message-freeze into lp:unity8

Proposed by Nick Dedekind on 2015-04-09
Status: Merged
Approved by: Albert Astals Cid on 2015-04-20
Approved revision: 1715
Merged at revision: 1733
Proposed branch: lp:~nick-dedekind/unity8/1436982.message-freeze
Merge into: lp:unity8
Diff against target: 1069 lines (+643/-146)
13 files modified
plugins/AccountsService/AccountsService.cpp (+304/-102)
plugins/AccountsService/AccountsService.h (+9/-9)
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp (+12/-2)
plugins/AccountsService/AccountsServiceDBusAdaptor.h (+3/-1)
tests/plugins/AccountsService/AccountsServer.cpp (+23/-7)
tests/plugins/AccountsService/AccountsServer.h (+11/-1)
tests/plugins/AccountsService/CMakeLists.txt (+8/-0)
tests/plugins/AccountsService/PropertiesServer.cpp (+43/-6)
tests/plugins/AccountsService/PropertiesServer.h (+8/-1)
tests/plugins/AccountsService/client.cpp (+187/-8)
tests/plugins/AccountsService/interfaces.xml (+22/-1)
tests/plugins/AccountsService/server.cpp (+12/-7)
tests/plugins/Unity/Launcher/CMakeLists.txt (+1/-1)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/1436982.message-freeze
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2015-04-09 Approve on 2015-04-20
PS Jenkins bot continuous-integration Needs Fixing on 2015-04-20
Review via email: mp+255702@code.launchpad.net

Commit Message

Use asynchronous dbus requests for property updates.

Description of the Change

Use asynchronous dbus requests for property updates. This fixes u8 stalls due to synchronous calls to the over zealous change notifications in accounts-service.

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
1707. By Nick Dedekind on 2015-04-10

line length

1708. By Nick Dedekind on 2015-04-13

fixed AccountsServiceDBusAdaptor.h local source inclusion

Albert Astals Cid (aacid) wrote :

updatePasswordDisplayHint uses "StatsWelcomeScreen" instead of PasswordDisplayHint

review: Needs Fixing
1709. By Nick Dedekind on 2015-04-15

Fixed interface and property for PasswordDisplayHint

Albert Astals Cid (aacid) wrote :

The deleteLaters of the first sync runs do not work because the the qapplication exec has still not be called.

I suggest adding a delete watcher inside the if (!async) { after the waitforfinished so we save those extra bytes

review: Needs Fixing
1710. By Nick Dedekind on 2015-04-16

delete watcher

1711. By Nick Dedekind on 2015-04-17

store sets + changed

1712. By Nick Dedekind on 2015-04-17

better tests

1713. By Nick Dedekind on 2015-04-17

removed debug

1714. By Nick Dedekind on 2015-04-17

line length

1715. By Nick Dedekind on 2015-04-17

whitespace

Nick Dedekind (nick-dedekind) wrote :

> The deleteLaters of the first sync runs do not work because the the
> qapplication exec has still not be called.
>
> I suggest adding a delete watcher inside the if (!async) { after the
> waitforfinished so we save those extra bytes

Fixed.

Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
AP seems to get randomly stuck somewhere :/

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/AccountsService/AccountsService.cpp'
2--- plugins/AccountsService/AccountsService.cpp 2015-03-03 09:30:42 +0000
3+++ plugins/AccountsService/AccountsService.cpp 2015-04-17 16:44:34 +0000
4@@ -21,6 +21,7 @@
5
6 #include <QFile>
7 #include <QStringList>
8+#include <QDebug>
9
10 AccountsService::AccountsService(QObject* parent)
11 : QObject(parent),
12@@ -56,15 +57,15 @@
13 m_user = user;
14 Q_EMIT userChanged();
15
16- updateDemoEdges();
17- updateEnableLauncherWhileLocked();
18- updateEnableIndicatorsWhileLocked();
19- updateBackgroundFile();
20- updateStatsWelcomeScreen();
21- updatePasswordDisplayHint();
22- updateFailedLogins();
23- updateHereEnabled();
24- updateHereLicensePath();
25+ updateDemoEdges(false);
26+ updateEnableLauncherWhileLocked(false);
27+ updateEnableIndicatorsWhileLocked(false);
28+ updateBackgroundFile(false);
29+ updateStatsWelcomeScreen(false);
30+ updatePasswordDisplayHint(false);
31+ updateFailedLogins(false);
32+ updateHereEnabled(false);
33+ updateHereLicensePath(false);
34 }
35
36 bool AccountsService::demoEdges() const
37@@ -74,8 +75,12 @@
38
39 void AccountsService::setDemoEdges(bool demoEdges)
40 {
41- m_demoEdges = demoEdges;
42- m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
43+ if (m_demoEdges != demoEdges) {
44+ m_demoEdges = demoEdges;
45+ m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
46+
47+ Q_EMIT demoEdgesChanged();
48+ }
49 }
50
51 bool AccountsService::enableLauncherWhileLocked() const
52@@ -110,7 +115,12 @@
53
54 void AccountsService::setHereEnabled(bool enabled)
55 {
56- m_service->setUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted", enabled);
57+ if (m_hereEnabled != enabled) {
58+ m_hereEnabled = enabled;
59+ m_service->setUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted", enabled);
60+
61+ Q_EMIT hereEnabledChanged();
62+ }
63 }
64
65 QString AccountsService::hereLicensePath() const
66@@ -123,102 +133,294 @@
67 return !m_hereLicensePath.isNull();
68 }
69
70-void AccountsService::updateDemoEdges()
71-{
72- auto demoEdges = m_service->getUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges").toBool();
73- if (m_demoEdges != demoEdges) {
74- m_demoEdges = demoEdges;
75- Q_EMIT demoEdgesChanged();
76- }
77-}
78-
79-void AccountsService::updateEnableLauncherWhileLocked()
80-{
81- auto enableLauncherWhileLocked = m_service->getUserProperty(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableLauncherWhileLocked").toBool();
82- if (m_enableLauncherWhileLocked != enableLauncherWhileLocked) {
83- m_enableLauncherWhileLocked = enableLauncherWhileLocked;
84- Q_EMIT enableLauncherWhileLockedChanged();
85- }
86-}
87-
88-void AccountsService::updateEnableIndicatorsWhileLocked()
89-{
90- auto enableIndicatorsWhileLocked = m_service->getUserProperty(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableIndicatorsWhileLocked").toBool();
91- if (m_enableIndicatorsWhileLocked != enableIndicatorsWhileLocked) {
92- m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
93- Q_EMIT enableIndicatorsWhileLockedChanged();
94- }
95-}
96-
97-void AccountsService::updateBackgroundFile()
98-{
99- QString backgroundFile = m_service->getUserProperty(m_user, "org.freedesktop.Accounts.User", "BackgroundFile").toString();
100- if (m_backgroundFile != backgroundFile) {
101- m_backgroundFile = backgroundFile;
102- Q_EMIT backgroundFileChanged();
103- }
104-}
105-
106-void AccountsService::updateStatsWelcomeScreen()
107-{
108- bool statsWelcomeScreen = m_service->getUserProperty(m_user, "com.ubuntu.touch.AccountsService.SecurityPrivacy", "StatsWelcomeScreen").toBool();
109- if (m_statsWelcomeScreen != statsWelcomeScreen) {
110- m_statsWelcomeScreen = statsWelcomeScreen;
111- Q_EMIT statsWelcomeScreenChanged();
112- }
113-}
114-
115-void AccountsService::updatePasswordDisplayHint()
116-{
117- PasswordDisplayHint passwordDisplayHint = (PasswordDisplayHint)m_service->getUserProperty(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "PasswordDisplayHint").toInt();
118- if (m_passwordDisplayHint != passwordDisplayHint) {
119- m_passwordDisplayHint = passwordDisplayHint;
120- Q_EMIT passwordDisplayHintChanged();
121- }
122-}
123-
124-void AccountsService::updateFailedLogins()
125-{
126- uint failedLogins = m_service->getUserProperty(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins").toUInt();
127+void AccountsService::updateDemoEdges(bool async)
128+{
129+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
130+ "com.canonical.unity.AccountsService",
131+ "demo-edges");
132+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
133+
134+ connect(watcher, &QDBusPendingCallWatcher::finished,
135+ this, [this](QDBusPendingCallWatcher* watcher) {
136+
137+ QDBusPendingReply<QDBusVariant> reply = *watcher;
138+ if (reply.isError()) {
139+ qWarning() << "Failed to get 'demo-edges' property - " << reply.error().message();
140+ watcher->deleteLater();
141+ return;
142+ }
143+
144+ auto demoEdges = reply.value().variant().toBool();
145+ if (m_demoEdges != demoEdges) {
146+ m_demoEdges = demoEdges;
147+ Q_EMIT demoEdgesChanged();
148+ }
149+ watcher->deleteLater();
150+ });
151+ if (!async) {
152+ watcher->waitForFinished();
153+ delete watcher;
154+ }
155+}
156+
157+void AccountsService::updateEnableLauncherWhileLocked(bool async)
158+{
159+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
160+ "com.ubuntu.AccountsService.SecurityPrivacy",
161+ "EnableLauncherWhileLocked");
162+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
163+
164+ connect(watcher, &QDBusPendingCallWatcher::finished,
165+ this, [this](QDBusPendingCallWatcher* watcher) {
166+
167+ QDBusPendingReply<QDBusVariant> reply = *watcher;
168+ if (reply.isError()) {
169+ qWarning() << "Failed to get 'EnableLauncherWhileLocked' property - " << reply.error().message();
170+ watcher->deleteLater();
171+ return;
172+ }
173+
174+ auto enableLauncherWhileLocked = reply.value().variant().toBool();
175+ if (m_enableLauncherWhileLocked != enableLauncherWhileLocked) {
176+ m_enableLauncherWhileLocked = enableLauncherWhileLocked;
177+ Q_EMIT enableLauncherWhileLockedChanged();
178+ }
179+ watcher->deleteLater();
180+ });
181+ if (!async) {
182+ watcher->waitForFinished();
183+ delete watcher;
184+ }
185+}
186+
187+void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
188+{
189+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
190+ "com.ubuntu.AccountsService.SecurityPrivacy",
191+ "EnableIndicatorsWhileLocked");
192+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
193+
194+ connect(watcher, &QDBusPendingCallWatcher::finished,
195+ this, [this](QDBusPendingCallWatcher* watcher) {
196+
197+ QDBusPendingReply<QDBusVariant> reply = *watcher;
198+ if (reply.isError()) {
199+ qWarning() << "Failed to get 'EnableIndicatorsWhileLocked' property - " << reply.error().message();
200+ watcher->deleteLater();
201+ return;
202+ }
203+
204+ auto enableIndicatorsWhileLocked = reply.value().variant().toBool();
205+ if (m_enableIndicatorsWhileLocked != enableIndicatorsWhileLocked) {
206+ m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
207+ Q_EMIT enableIndicatorsWhileLockedChanged();
208+ }
209+ watcher->deleteLater();
210+ });
211+ if (!async) {
212+ watcher->waitForFinished();
213+ delete watcher;
214+ }
215+}
216+
217+void AccountsService::updateBackgroundFile(bool async)
218+{
219+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
220+ "org.freedesktop.Accounts.User",
221+ "BackgroundFile");
222+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
223+
224+ connect(watcher, &QDBusPendingCallWatcher::finished,
225+ this, [this](QDBusPendingCallWatcher* watcher) {
226+
227+ QDBusPendingReply<QDBusVariant> reply = *watcher;
228+ if (reply.isError()) {
229+ qWarning() << "Failed to get 'BackgroundFile' property - " << reply.error().message();
230+ watcher->deleteLater();
231+ return;
232+ }
233+
234+ auto backgroundFile = reply.value().variant().toString();
235+ if (m_backgroundFile != backgroundFile) {
236+ m_backgroundFile = backgroundFile;
237+ Q_EMIT backgroundFileChanged();
238+ }
239+ watcher->deleteLater();
240+ });
241+ if (!async) {
242+ watcher->waitForFinished();
243+ delete watcher;
244+ }
245+}
246+
247+void AccountsService::updateStatsWelcomeScreen(bool async)
248+{
249+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
250+ "com.ubuntu.touch.AccountsService.SecurityPrivacy",
251+ "StatsWelcomeScreen");
252+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
253+
254+ connect(watcher, &QDBusPendingCallWatcher::finished,
255+ this, [this](QDBusPendingCallWatcher* watcher) {
256+
257+ QDBusPendingReply<QDBusVariant> reply = *watcher;
258+ if (reply.isError()) {
259+ qWarning() << "Failed to get 'StatsWelcomeScreen' property - " << reply.error().message();
260+ watcher->deleteLater();
261+ return;
262+ }
263+
264+ auto statsWelcomeScreen = reply.value().variant().toBool();
265+ if (m_statsWelcomeScreen != statsWelcomeScreen) {
266+ m_statsWelcomeScreen = statsWelcomeScreen;
267+ Q_EMIT statsWelcomeScreenChanged();
268+ }
269+ watcher->deleteLater();
270+ });
271+ if (!async) {
272+ watcher->waitForFinished();
273+ delete watcher;
274+ }
275+}
276+
277+void AccountsService::updatePasswordDisplayHint(bool async)
278+{
279+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
280+ "com.ubuntu.AccountsService.SecurityPrivacy",
281+ "PasswordDisplayHint");
282+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
283+
284+ connect(watcher, &QDBusPendingCallWatcher::finished,
285+ this, [this](QDBusPendingCallWatcher* watcher) {
286+
287+ QDBusPendingReply<QDBusVariant> reply = *watcher;
288+ if (reply.isError()) {
289+ qWarning() << "Failed to get 'PasswordDisplayHint' property - " << reply.error().message();
290+ watcher->deleteLater();
291+ return;
292+ }
293+
294+ PasswordDisplayHint passwordDisplayHint = (PasswordDisplayHint)reply.value().variant().toInt();
295+ if (m_passwordDisplayHint != passwordDisplayHint) {
296+ m_passwordDisplayHint = passwordDisplayHint;
297+ Q_EMIT passwordDisplayHintChanged();
298+ }
299+ watcher->deleteLater();
300+ });
301+ if (!async) {
302+ watcher->waitForFinished();
303+ delete watcher;
304+ }
305+}
306+
307+void AccountsService::updateFailedLogins(bool async)
308+{
309+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
310+ "com.canonical.unity.AccountsService.Private",
311+ "FailedLogins");
312+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
313+
314+ connect(watcher, &QDBusPendingCallWatcher::finished,
315+ this, [this](QDBusPendingCallWatcher* watcher) {
316+
317+ QDBusPendingReply<QDBusVariant> reply = *watcher;
318+ if (reply.isError()) {
319+ qWarning() << "Failed to get 'FailedLogins' property - " << reply.error().message();
320+ watcher->deleteLater();
321+ return;
322+ }
323+
324+ uint failedLogins = reply.value().variant().toUInt();
325+ if (m_failedLogins != failedLogins) {
326+ m_failedLogins = failedLogins;
327+ Q_EMIT failedLoginsChanged();
328+ }
329+ watcher->deleteLater();
330+ });
331+ if (!async) {
332+ watcher->waitForFinished();
333+ delete watcher;
334+ }
335+}
336+
337+void AccountsService::updateHereEnabled(bool async)
338+{
339+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
340+ "com.ubuntu.location.providers.here.AccountsService",
341+ "LicenseAccepted");
342+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
343+
344+ connect(watcher, &QDBusPendingCallWatcher::finished,
345+ this, [this](QDBusPendingCallWatcher* watcher) {
346+
347+ QDBusPendingReply<QDBusVariant> reply = *watcher;
348+ if (reply.isError()) {
349+ qWarning() << "Failed to get 'LicenseAccepted' property - " << reply.error().message();
350+ watcher->deleteLater();
351+ return;
352+ }
353+
354+ auto hereEnabled = reply.value().variant().toBool();
355+ if (m_hereEnabled != hereEnabled) {
356+ m_hereEnabled = hereEnabled;
357+ Q_EMIT hereEnabledChanged();
358+ }
359+ watcher->deleteLater();
360+ });
361+ if (!async) {
362+ watcher->waitForFinished();
363+ delete watcher;
364+ }
365+}
366+
367+void AccountsService::updateHereLicensePath(bool async)
368+{
369+ QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
370+ "com.ubuntu.location.providers.here.AccountsService",
371+ "LicenseBasePath");
372+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
373+
374+ connect(watcher, &QDBusPendingCallWatcher::finished,
375+ this, [this](QDBusPendingCallWatcher* watcher) {
376+
377+ QDBusPendingReply<QDBusVariant> reply = *watcher;
378+ if (reply.isError()) {
379+ qWarning() << "Failed to get 'LicenseBasePath' property - " << reply.error().message();
380+ watcher->deleteLater();
381+ return;
382+ }
383+
384+ auto hereLicensePath = reply.value().variant().toString();
385+ if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
386+ hereLicensePath = "";
387+
388+ if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
389+ m_hereLicensePath = hereLicensePath;
390+ Q_EMIT hereLicensePathChanged();
391+ }
392+ watcher->deleteLater();
393+ });
394+ if (!async) {
395+ watcher->waitForFinished();
396+ delete watcher;
397+ }
398+}
399+
400+uint AccountsService::failedLogins() const
401+{
402+ return m_failedLogins;
403+}
404+
405+void AccountsService::setFailedLogins(uint failedLogins)
406+{
407 if (m_failedLogins != failedLogins) {
408 m_failedLogins = failedLogins;
409+ m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins", failedLogins);
410+
411 Q_EMIT failedLoginsChanged();
412 }
413 }
414
415-void AccountsService::updateHereEnabled()
416-{
417- bool hereEnabled = m_service->getUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted").toBool();
418- if (m_hereEnabled != hereEnabled) {
419- m_hereEnabled = hereEnabled;
420- Q_EMIT hereEnabledChanged();
421- }
422-}
423-
424-void AccountsService::updateHereLicensePath()
425-{
426- QString hereLicensePath = m_service->getUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseBasePath").toString();
427-
428- if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
429- hereLicensePath = "";
430-
431- if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
432- m_hereLicensePath = hereLicensePath;
433- Q_EMIT hereLicensePathChanged();
434- }
435-}
436-
437-uint AccountsService::failedLogins() const
438-{
439- return m_failedLogins;
440-}
441-
442-void AccountsService::setFailedLogins(uint failedLogins)
443-{
444- m_failedLogins = failedLogins;
445- m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins", failedLogins);
446-}
447-
448 void AccountsService::propertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
449 {
450 if (m_user != user) {
451
452=== modified file 'plugins/AccountsService/AccountsService.h'
453--- plugins/AccountsService/AccountsService.h 2014-11-24 17:42:36 +0000
454+++ plugins/AccountsService/AccountsService.h 2015-04-17 16:44:34 +0000
455@@ -107,15 +107,15 @@
456 void maybeChanged(const QString &user);
457
458 private:
459- void updateDemoEdges();
460- void updateEnableLauncherWhileLocked();
461- void updateEnableIndicatorsWhileLocked();
462- void updateBackgroundFile();
463- void updateStatsWelcomeScreen();
464- void updatePasswordDisplayHint();
465- void updateFailedLogins();
466- void updateHereEnabled();
467- void updateHereLicensePath();
468+ void updateDemoEdges(bool async = true);
469+ void updateEnableLauncherWhileLocked(bool async = true);
470+ void updateEnableIndicatorsWhileLocked(bool async = true);
471+ void updateBackgroundFile(bool async = true);
472+ void updateStatsWelcomeScreen(bool async = true);
473+ void updatePasswordDisplayHint(bool async = true);
474+ void updateFailedLogins(bool async = true);
475+ void updateHereEnabled(bool async = true);
476+ void updateHereLicensePath(bool async = true);
477
478 AccountsServiceDBusAdaptor *m_service;
479 QString m_user;
480
481=== modified file 'plugins/AccountsService/AccountsServiceDBusAdaptor.cpp'
482--- plugins/AccountsService/AccountsServiceDBusAdaptor.cpp 2015-03-04 15:57:41 +0000
483+++ plugins/AccountsService/AccountsServiceDBusAdaptor.cpp 2015-04-17 16:44:34 +0000
484@@ -49,6 +49,15 @@
485 return QVariant();
486 }
487
488+QDBusPendingReply<QDBusVariant> AccountsServiceDBusAdaptor::getUserPropertyAsync(const QString &user, const QString &interface, const QString &property)
489+{
490+ QDBusInterface *iface = getUserInterface(user);
491+ if (iface != nullptr && iface->isValid()) {
492+ return iface->asyncCall("Get", interface, property);
493+ }
494+ return QDBusPendingReply<QVariant>(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
495+}
496+
497 void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
498 {
499 QDBusInterface *iface = getUserInterface(user);
500@@ -58,13 +67,14 @@
501 }
502 }
503
504-void AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value)
505+QDBusPendingCall AccountsServiceDBusAdaptor::setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value)
506 {
507 QDBusInterface *iface = getUserInterface(user);
508 if (iface != nullptr && iface->isValid()) {
509 // The value needs to be carefully wrapped
510- iface->asyncCall("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
511+ return iface->asyncCall("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
512 }
513+ return QDBusPendingCall::fromCompletedCall(QDBusMessage::createError(QDBusError::Other, "Invalid Interface"));
514 }
515
516 void AccountsServiceDBusAdaptor::propertiesChangedSlot(const QString &interface, const QVariantMap &changed, const QStringList &invalid)
517
518=== modified file 'plugins/AccountsService/AccountsServiceDBusAdaptor.h'
519--- plugins/AccountsService/AccountsServiceDBusAdaptor.h 2015-03-03 09:30:42 +0000
520+++ plugins/AccountsService/AccountsServiceDBusAdaptor.h 2015-04-17 16:44:34 +0000
521@@ -22,6 +22,7 @@
522 #include <QDBusArgument>
523 #include <QDBusContext>
524 #include <QDBusInterface>
525+#include <QDBusPendingReply>
526 #include <QMap>
527 #include <QObject>
528 #include <QString>
529@@ -34,6 +35,7 @@
530 explicit AccountsServiceDBusAdaptor(QObject *parent = 0);
531
532 Q_INVOKABLE QVariant getUserProperty(const QString &user, const QString &interface, const QString &property);
533+ Q_INVOKABLE QDBusPendingReply<QDBusVariant> getUserPropertyAsync(const QString &user, const QString &interface, const QString &property);
534
535 template <typename T>
536 inline T getUserProperty(const QString &user, const QString &interface, const QString &property) {
537@@ -45,7 +47,7 @@
538 }
539
540 Q_INVOKABLE void setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value);
541- Q_INVOKABLE void setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
542+ Q_INVOKABLE QDBusPendingCall setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
543
544 Q_SIGNALS:
545 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
546
547=== modified file 'tests/plugins/AccountsService/AccountsServer.cpp'
548--- tests/plugins/AccountsService/AccountsServer.cpp 2013-08-13 23:35:31 +0000
549+++ tests/plugins/AccountsService/AccountsServer.cpp 2015-04-17 16:44:34 +0000
550@@ -18,18 +18,34 @@
551 */
552
553 #include "AccountsServer.h"
554+#include "PropertiesServer.h"
555+#include <QDBusConnection>
556+#include <QDebug>
557
558-AccountsServer::AccountsServer(QObject *parent)
559+AccountsServer::AccountsServer(PropertiesServer* propServer, QObject *parent)
560 : QObject(parent)
561+ , m_propServer(propServer)
562 {
563 }
564
565 QDBusObjectPath AccountsServer::FindUserByName(const QString &user)
566 {
567- if (user == "testuser") {
568- return QDBusObjectPath("/user");
569- } else {
570- sendErrorReply(QDBusError::InvalidArgs, "Bad user");
571- return QDBusObjectPath("/");
572- }
573+ return QDBusObjectPath(QString("/%1").arg(user));
574+}
575+
576+bool AccountsServer::AddUser(const QString &user)
577+{
578+ QString path(QString("/%1").arg(user));
579+ if (QDBusConnection::sessionBus().objectRegisteredAt(path) == m_propServer)
580+ return true;
581+ return QDBusConnection::sessionBus().registerObject(path, m_propServer);
582+}
583+
584+bool AccountsServer::RemoveUser(const QString &user)
585+{
586+ QString path(QString("/%1").arg(user));
587+ if (QDBusConnection::sessionBus().objectRegisteredAt(path) != m_propServer)
588+ return false;
589+ QDBusConnection::sessionBus().unregisterObject(path);
590+ return true;
591 }
592
593=== modified file 'tests/plugins/AccountsService/AccountsServer.h'
594--- tests/plugins/AccountsService/AccountsServer.h 2013-08-22 20:16:41 +0000
595+++ tests/plugins/AccountsService/AccountsServer.h 2015-04-17 16:44:34 +0000
596@@ -25,15 +25,25 @@
597 #include <QObject>
598 #include <QString>
599
600+class PropertiesServer;
601+
602 class AccountsServer: public QObject, protected QDBusContext
603 {
604 Q_OBJECT
605
606 public:
607- explicit AccountsServer(QObject *parent = 0);
608+ explicit AccountsServer(PropertiesServer *propServer, QObject *parent = 0);
609
610 public Q_SLOTS:
611+
612 QDBusObjectPath FindUserByName(const QString &user);
613+
614+ // mock only.
615+ bool AddUser(const QString &user);
616+ bool RemoveUser(const QString &user);
617+
618+private:
619+ PropertiesServer* m_propServer;
620 };
621
622 #endif
623
624=== modified file 'tests/plugins/AccountsService/CMakeLists.txt'
625--- tests/plugins/AccountsService/CMakeLists.txt 2013-12-13 01:02:53 +0000
626+++ tests/plugins/AccountsService/CMakeLists.txt 2015-04-17 16:44:34 +0000
627@@ -11,6 +11,10 @@
628
629 make_dbus_class(Accounts org.freedesktop.Accounts)
630 make_dbus_class(Properties org.freedesktop.DBus.Properties)
631+make_dbus_class(SecurityPrivacy com.ubuntu.touch.AccountsService.SecurityPrivacy)
632+make_dbus_class(Location com.ubuntu.location.providers.here.AccountsService)
633+make_dbus_class(AccountsUser org.freedesktop.Accounts.User)
634+make_dbus_class(AccountsPrivate com.canonical.unity.AccountsService.Private)
635
636 include_directories(
637 ${CMAKE_CURRENT_BINARY_DIR}
638@@ -21,7 +25,11 @@
639
640 add_executable(mock-server
641 ${CMAKE_CURRENT_BINARY_DIR}/AccountsAdaptor.cpp
642+ ${CMAKE_CURRENT_BINARY_DIR}/AccountsPrivateAdaptor.cpp
643+ ${CMAKE_CURRENT_BINARY_DIR}/AccountsUserAdaptor.cpp
644 ${CMAKE_CURRENT_BINARY_DIR}/PropertiesAdaptor.cpp
645+ ${CMAKE_CURRENT_BINARY_DIR}/LocationAdaptor.cpp
646+ ${CMAKE_CURRENT_BINARY_DIR}/SecurityPrivacyAdaptor.cpp
647 server.cpp
648 AccountsServer.cpp
649 PropertiesServer.cpp
650
651=== modified file 'tests/plugins/AccountsService/PropertiesServer.cpp'
652--- tests/plugins/AccountsService/PropertiesServer.cpp 2013-08-13 23:35:31 +0000
653+++ tests/plugins/AccountsService/PropertiesServer.cpp 2015-04-17 16:44:34 +0000
654@@ -18,17 +18,22 @@
655 */
656
657 #include "PropertiesServer.h"
658+#include "AccountsService.h"
659+
660+// Qt
661+#include <QDebug>
662+#include <QDBusMessage>
663
664 PropertiesServer::PropertiesServer(QObject *parent)
665- : QObject(parent),
666- edge_demo(true)
667+ : QObject(parent)
668 {
669+ Reset();
670 }
671
672 QDBusVariant PropertiesServer::Get(const QString &interface, const QString &property)
673 {
674- if (interface == "com.canonical.unity.AccountsService" && property == "demo-edges") {
675- return QDBusVariant(QVariant(edge_demo));
676+ if (m_properties[interface].contains(property)) {
677+ return QDBusVariant(m_properties[interface][property]);
678 } else {
679 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
680 return QDBusVariant(QVariant());
681@@ -37,9 +42,41 @@
682
683 void PropertiesServer::Set(const QString &interface, const QString &property, const QDBusVariant &variant)
684 {
685- if (interface == "com.canonical.unity.AccountsService" && property == "demo-edges") {
686- edge_demo = variant.variant().toBool();
687+ QVariant newValue = variant.variant();
688+
689+ if (m_properties[interface].contains(property)) {
690+ QVariant& oldValue = m_properties[interface][property];
691+ if (oldValue != newValue) {
692+ oldValue = newValue;
693+
694+ // Special case for Background file.
695+ if (interface == "org.freedesktop.Accounts.User" && property == "BackgroundFile") {
696+ Q_EMIT Changed();
697+ } else {
698+ QVariantMap propertyChanges;
699+ propertyChanges[property] = newValue;
700+ Q_EMIT PropertiesChanged(interface, propertyChanges, QStringList());
701+
702+ // FIXME: Here to replicate current behaviour
703+ // Not sure why accounts-service is triggering Changed when we're
704+ // emitting PropertyChanges from org.freedesktop.DBus.Properties as well.
705+ Q_EMIT Changed();
706+ }
707+ }
708 } else {
709 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
710 }
711 }
712+
713+void PropertiesServer::Reset()
714+{
715+ m_properties["com.canonical.unity.AccountsService"]["demo-edges"] = false;
716+ m_properties["com.canonical.unity.AccountsService.Private"]["FailedLogins"] = 0;
717+ m_properties["com.ubuntu.touch.AccountsService.SecurityPrivacy"]["StatsWelcomeScreen"] = true;
718+ m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableLauncherWhileLocked"] = true;
719+ m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableIndicatorsWhileLocked"] = true;
720+ m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["PasswordDisplayHint"] = AccountsService::Keyboard;
721+ m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseAccepted"] = false;
722+ m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseBasePath"] = "";
723+ m_properties["org.freedesktop.Accounts.User"]["BackgroundFile"] = "";
724+}
725
726=== modified file 'tests/plugins/AccountsService/PropertiesServer.h'
727--- tests/plugins/AccountsService/PropertiesServer.h 2013-08-22 20:16:41 +0000
728+++ tests/plugins/AccountsService/PropertiesServer.h 2015-04-17 16:44:34 +0000
729@@ -37,8 +37,15 @@
730 QDBusVariant Get(const QString &interface, const QString &property);
731 void Set(const QString &interface, const QString &property, const QDBusVariant &variant);
732
733+ // mock only.
734+ void Reset();
735+
736+Q_SIGNALS:
737+ void PropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
738+ void Changed();
739+
740 private:
741- bool edge_demo;
742+ QHash<QString, QVariantMap> m_properties;
743 };
744
745 #endif
746
747=== modified file 'tests/plugins/AccountsService/client.cpp'
748--- tests/plugins/AccountsService/client.cpp 2013-09-19 15:36:54 +0000
749+++ tests/plugins/AccountsService/client.cpp 2015-04-17 16:44:34 +0000
750@@ -21,39 +21,218 @@
751 #include "AccountsServiceDBusAdaptor.h"
752 #include <QSignalSpy>
753 #include <QTest>
754+#include <QDebug>
755+#include <QDBusReply>
756+
757+template <class T>
758+QVariant dbusVariant(const T& value) { return QVariant::fromValue(QDBusVariant(value)); }
759+
760+#define ASSERT_DBUS_CALL(call) \
761+ { \
762+ QDBusReply<void> reply = call; \
763+ if (!reply.isValid()) QFAIL(reply.error().message().toLatin1()); \
764+ }
765
766 class AccountsServiceTest : public QObject
767 {
768 Q_OBJECT
769
770+public:
771+ AccountsServiceTest(QObject* parent = 0)
772+ : QObject(parent)
773+ , m_userInterface(nullptr)
774+ , m_spy(this, &AccountsServiceTest::propertiesChanged)
775+ {
776+ }
777+
778 private Q_SLOTS:
779
780+ void init() {
781+ QDBusReply<bool> addReply = QDBusInterface("org.freedesktop.Accounts",
782+ "/org/freedesktop/Accounts",
783+ "org.freedesktop.Accounts").call("AddUser", QTest::currentTestFunction());
784+ QVERIFY(addReply.isValid());
785+ QCOMPARE(addReply.value(), true);
786+
787+ m_userInterface = new QDBusInterface("org.freedesktop.Accounts",
788+ QString("/%1").arg(QTest::currentTestFunction()),
789+ "org.freedesktop.DBus.Properties", QDBusConnection::sessionBus(), this);
790+ QDBusReply<void> resetReply = m_userInterface->call("Reset");
791+ QVERIFY(resetReply.isValid());
792+
793+ QVERIFY(QObject::connect(m_userInterface, SIGNAL(PropertiesChanged(QString, QVariantMap, QStringList)),
794+ this, SIGNAL(propertiesChanged(QString, QVariantMap, QStringList))));
795+ }
796+
797+ void cleanup() {
798+ QDBusReply<bool> reply = QDBusInterface("org.freedesktop.Accounts",
799+ "/org/freedesktop/Accounts",
800+ "org.freedesktop.Accounts").call("RemoveUser", QTest::currentTestFunction());
801+ QVERIFY(reply.isValid());
802+ QCOMPARE(reply.value(), true);
803+
804+ delete m_userInterface;
805+ m_spy.clear();
806+ }
807+
808 void testInvalids()
809 {
810 // Test various invalid calls
811 AccountsServiceDBusAdaptor session;
812 QCOMPARE(session.getUserProperty("NOPE", "com.canonical.unity.AccountsService", "demo-edges"), QVariant());
813- QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "NOPE"), QVariant());
814+ QCOMPARE(session.getUserProperty(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "NOPE"), QVariant());
815 }
816
817 void testGetSetServiceDBusAdaptor()
818 {
819 AccountsServiceDBusAdaptor session;
820- session.setUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges", QVariant(true));
821- QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges"), QVariant(true));
822- session.setUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges", QVariant(false));
823- QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges"), QVariant(false));
824+ session.setUserProperty(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges", QVariant(true));
825+ QCOMPARE(session.getUserProperty(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges"), QVariant(true));
826+ session.setUserProperty(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges", QVariant(false));
827+ QCOMPARE(session.getUserProperty(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges"), QVariant(false));
828 }
829
830 void testGetSetService()
831 {
832 AccountsService session;
833- session.setUser("testuser");
834+ session.setUser(QTest::currentTestFunction());
835+
836+ QCOMPARE(session.demoEdges(), false);
837 session.setDemoEdges(true);
838 QCOMPARE(session.demoEdges(), true);
839- session.setDemoEdges(false);
840+
841+ QCOMPARE(session.failedLogins(), (uint)0);
842+ session.setFailedLogins(5);
843+ QCOMPARE(session.failedLogins(), (uint)5);
844+
845+ QCOMPARE(session.hereEnabled(), false);
846+ session.setHereEnabled(true);
847+ QCOMPARE(session.hereEnabled(), true);
848+ }
849+
850+ void testAsynchornousChangeForDemoEdges()
851+ {
852+ AccountsService session;
853+ session.setUser(QTest::currentTestFunction());
854+
855 QCOMPARE(session.demoEdges(), false);
856- }
857+ ASSERT_DBUS_CALL(m_userInterface->call("Set",
858+ "com.canonical.unity.AccountsService",
859+ "demo-edges",
860+ dbusVariant(true)));
861+ QTRY_COMPARE(session.demoEdges(), true);
862+ }
863+
864+ void testAsynchornousChangeForFailedLogins()
865+ {
866+ AccountsService session;
867+ session.setUser(QTest::currentTestFunction());
868+
869+ QCOMPARE(session.failedLogins(), (uint)0);
870+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
871+ "com.canonical.unity.AccountsService.Private",
872+ "FailedLogins",
873+ dbusVariant(5)));
874+ QTRY_COMPARE(session.failedLogins(), (uint)5);
875+ }
876+
877+ void testAsynchornousChangeForStatsWelcomeScreen()
878+ {
879+ AccountsService session;
880+ session.setUser(QTest::currentTestFunction());
881+
882+ QCOMPARE(session.statsWelcomeScreen(), true);
883+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
884+ "com.ubuntu.touch.AccountsService.SecurityPrivacy",
885+ "StatsWelcomeScreen",
886+ dbusVariant(false)));
887+ QTRY_COMPARE(session.statsWelcomeScreen(), false);
888+ }
889+
890+ void testAsynchornousChangeForStatsEnableLauncherWhileLocked()
891+ {
892+ AccountsService session;
893+ session.setUser(QTest::currentTestFunction());
894+
895+ QCOMPARE(session.enableLauncherWhileLocked(), true);
896+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
897+ "com.ubuntu.AccountsService.SecurityPrivacy",
898+ "EnableLauncherWhileLocked",
899+ dbusVariant(false)));
900+ QTRY_COMPARE(session.enableLauncherWhileLocked(), false);
901+ }
902+
903+ void testAsynchornousChangeForStatsEnableIndicatorsWhileLocked()
904+ {
905+ AccountsService session;
906+ session.setUser(QTest::currentTestFunction());
907+
908+ QCOMPARE(session.enableIndicatorsWhileLocked(), true);
909+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
910+ "com.ubuntu.AccountsService.SecurityPrivacy",
911+ "EnableIndicatorsWhileLocked",
912+ dbusVariant(false)));
913+ QTRY_COMPARE(session.enableIndicatorsWhileLocked(), false);
914+ }
915+
916+ void testAsynchornousChangeForStatsPasswordDisplayHint()
917+ {
918+ AccountsService session;
919+ session.setUser(QTest::currentTestFunction());
920+
921+ QCOMPARE(session.passwordDisplayHint(), AccountsService::Keyboard);
922+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
923+ "com.ubuntu.AccountsService.SecurityPrivacy",
924+ "PasswordDisplayHint",
925+ dbusVariant(AccountsService::Numeric)));
926+ QTRY_COMPARE(session.passwordDisplayHint(), AccountsService::Numeric);
927+ }
928+
929+ void testAsynchornousChangeForStatsLicenseAccepted()
930+ {
931+ AccountsService session;
932+ session.setUser(QTest::currentTestFunction());
933+
934+ QCOMPARE(session.hereEnabled(), false);
935+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
936+ "com.ubuntu.location.providers.here.AccountsService",
937+ "LicenseAccepted",
938+ dbusVariant(true)));
939+ QTRY_COMPARE(session.hereEnabled(), true);
940+ }
941+
942+ void testAsynchornousChangeForLicenseBasePath()
943+ {
944+ AccountsService session;
945+ session.setUser(QTest::currentTestFunction());
946+
947+ QCOMPARE(session.hereLicensePath(), QString());
948+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
949+ "com.ubuntu.location.providers.here.AccountsService",
950+ "LicenseBasePath",
951+ dbusVariant("/")));
952+ QTRY_COMPARE(session.hereLicensePath(), QString("/"));
953+ }
954+
955+ void testAsynchornousChangeForStatsBackgroundFile()
956+ {
957+ AccountsService session;
958+ session.setUser(QTest::currentTestFunction());
959+
960+ QCOMPARE(session.backgroundFile(), QString());
961+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
962+ "org.freedesktop.Accounts.User",
963+ "BackgroundFile",
964+ dbusVariant("/test/BackgroundFile")));
965+ QTRY_COMPARE(session.backgroundFile(), QString("/test/BackgroundFile"));
966+ }
967+
968+Q_SIGNALS:
969+ void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
970+
971+private:
972+ QDBusInterface* m_userInterface;
973+ QSignalSpy m_spy;
974 };
975
976 QTEST_MAIN(AccountsServiceTest)
977
978=== modified file 'tests/plugins/AccountsService/interfaces.xml'
979--- tests/plugins/AccountsService/interfaces.xml 2013-08-13 23:35:31 +0000
980+++ tests/plugins/AccountsService/interfaces.xml 2015-04-17 16:44:34 +0000
981@@ -10,11 +10,32 @@
982 <arg name="property" type="s" direction="in" />
983 <arg name="value" type="v" direction="in" />
984 </method>
985+ <method name="Reset" />
986+ <signal name="PropertiesChanged">
987+ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
988+ <arg name="interface" type="s" direction="out" />
989+ <arg name="changed" type="a{sv}" direction="out" />
990+ <arg name="invalid" type="as" direction="out" />
991+ </signal>
992 </interface>
993 <interface name="org.freedesktop.Accounts">
994 <method name="FindUserByName">
995 <arg name="user" type="s" direction="in" />
996 <arg name="path" type="o" direction="out" />
997 </method>
998- </interface>
999+ <method name="AddUser">
1000+ <arg name="user" type="s" direction="in" />
1001+ <arg name="success" type="b" direction="out" />
1002+ </method>
1003+ <method name="RemoveUser">
1004+ <arg name="user" type="s" direction="in" />
1005+ <arg name="success" type="b" direction="out" />
1006+ </method>
1007+ </interface>
1008+ <interface name="com.ubuntu.touch.AccountsService.SecurityPrivacy" />
1009+ <interface name="com.ubuntu.location.providers.here.AccountsService" />
1010+ <interface name="org.freedesktop.Accounts.User">
1011+ <signal name="Changed" />
1012+ </interface>
1013+ <interface name="com.canonical.unity.AccountsService.Private" />
1014 </node>
1015
1016=== modified file 'tests/plugins/AccountsService/server.cpp'
1017--- tests/plugins/AccountsService/server.cpp 2013-08-22 14:54:08 +0000
1018+++ tests/plugins/AccountsService/server.cpp 2015-04-17 16:44:34 +0000
1019@@ -21,24 +21,29 @@
1020 #include "AccountsServer.h"
1021 #include "PropertiesAdaptor.h"
1022 #include "PropertiesServer.h"
1023+#include "SecurityPrivacyAdaptor.h"
1024+#include "LocationAdaptor.h"
1025+#include "AccountsUserAdaptor.h"
1026+#include "AccountsPrivateAdaptor.h"
1027 #include <QCoreApplication>
1028
1029 int main(int argc, char *argv[])
1030 {
1031 QCoreApplication a(argc, argv);
1032
1033- auto accounts = new AccountsServer();
1034+ auto props = new PropertiesServer(&a);
1035+ new PropertiesAdaptor(props);
1036+ new AccountsUserAdaptor(props);
1037+
1038+ auto accounts = new AccountsServer(props, &a);
1039 new AccountsAdaptor(accounts);
1040-
1041- auto props = new PropertiesServer();
1042- new PropertiesAdaptor(props);
1043-
1044+ new SecurityPrivacyAdaptor(accounts);
1045+ new LocationAdaptor(accounts);
1046+ new AccountsPrivateAdaptor(accounts);
1047 // We use the session bus for testing. The real plugin uses the system bus
1048 auto connection = QDBusConnection::sessionBus();
1049 if (!connection.registerObject("/org/freedesktop/Accounts", accounts))
1050 return 1;
1051- if (!connection.registerObject("/user", props))
1052- return 1;
1053 if (!connection.registerService("org.freedesktop.Accounts"))
1054 return 1;
1055
1056
1057=== modified file 'tests/plugins/Unity/Launcher/CMakeLists.txt'
1058--- tests/plugins/Unity/Launcher/CMakeLists.txt 2015-02-11 13:43:17 +0000
1059+++ tests/plugins/Unity/Launcher/CMakeLists.txt 2015-04-17 16:44:34 +0000
1060@@ -3,8 +3,8 @@
1061 pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=5)
1062
1063 include_directories(
1064+ ${CMAKE_CURRENT_SOURCE_DIR}
1065 ${CMAKE_CURRENT_BINARY_DIR}
1066- ${CMAKE_SOURCE_DIR}/plugins/AccountsService
1067 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher
1068 ${GSETTINGS_QT_INCLUDE_DIRS}
1069 ${libunity8-private_SOURCE_DIR}

Subscribers

People subscribed via source and target branches