~cimi/unity8/sdk1.3_newUbuntuShape

« back to all changes in this revision

Viewing changes to plugins/AccountsService/AccountsService.cpp

  • Committer: Andrea Cimitan
  • Date: 2015-10-23 10:05:59 UTC
  • mfrom: (1821.1.36 use_sdk_13)
  • Revision ID: andrea.cimitan@gmail.com-20151023100559-fi60ots87umsplq1
[ CI Train Bot ]
* New rebuild forced.
[ Pawel Stolowski ]
* Store unity8 package version in /var/lib/.../version file for fast
  retrieval from the shell plugin.
[ Lukáš Tinkl ]
* Revert to using plaintext instead of HTML-like markup for the
  notifications (LP: #1504256)
[ CI Train Bot ]
* Resync trunk.
[ Lukáš Tinkl ]
* Wizard: skip the reporting page if the system is configured not to
  report crashes (LP: #1494442)
[ Alexandros Frantzis ]
* Use power state change reason SnapDecision to turn screen on when a
  SnapDecision arrives (LP: #1291455)
[ CI Train Bot ]
* New rebuild forced.
[ Albert Astals Cid ]
* Make Launcher::test_quickListMenuOnRMB stable (LP: #1500359)
[ CI Train Bot ]
* New rebuild forced.
[ Michael Zanetti ]
* Stabilize Launcher DND test
[ Albert Astals Cid ]
* Improvements from running clazy over the code
[ Daniel d'Andrada ]
* PhoneStage: ensure you're left in a consistent state after being
  reset (LP: #1476757)
[ Lukáš Tinkl ]
* Improve the appearance and functionality of datetime and session
  indicators in Unity8 desktop.
* Using InputInfo, determine if we need swipe or click to dismiss the
  notifications (e.g. incoming phone call)
[ Michael Zanetti ]
* further development on the Desktop Spread (LP: #1488147)
[ Michał Sawicz ]
* Bump application API version
* Skip bluetooth check under wily, use expectFailure to notice when
  it's back
[ Richard Somlói ]
* Fix translator comments in time formatter
[ Albert Astals Cid ]
* Adapt test to code changes
* Add DEP-8 test for all our UI and unit tests
* Keep the PreviewStack around to avoid mem leaks (LP: #1495467)
[ CI Train Bot ]
* Resync trunk.
[ Michael Terry ]
* When libusermetrics gives us an empty string, still show the
  infographic circle rather than hiding it.  This is a follow-on to a
  branch [1] that changes the "no data available" label to the empty
  string.
[ Michał Sawicz ]
* Add DEP-8 test for all our UI and unit tests
* Fix integrated LightDM path
* Resync trunk
[ Albert Astals Cid ]
* Fix testNotifications
* Make the wait longer to make tests pass in CI
* New simplified CroppedImageMinimumSourceSize (LP: #1467740)
* Stop animateTimer when starting the fadeOutAnimation
* Use  AlreadyLaunchedUpstart so that tests passes
* Workaround keyboard issues and make test pass again
[ Daniel d'Andrada ]
* DesktopStage: Refactor focus handling
* Stabilize tstShell.test_launchedAppHasActiveFocus
[ Gary.Wzl ]
* Add widgetData["expanded"] property for expandable widget.
[ Michael Terry ]
* Fix typo that caused the tutorial to tease the launcher on top of
  the greeter.
* Fix typo that caused the tutorial to tease the launcher on top of
  the greeter.
[ Michal Sawicz ]
* Resync wily with vivid
[ Albert Astals Cid ]
* Accomodate header height when using a card carousel with non
  overlayed header (LP: #1489309)
* Fix restart unity8 from inside the phone more than two times (LP:
  #1487946)
[ Gary.Wzl ]
* Move textarea up automatically when inputmethod popup. (LP:
  #1485947)
[ Lukáš Tinkl ]
* Introduce a GlobalShortcut QML component for handling global
  keyboard shortcuts
[ Michael Terry ]
* Fix the fact that a user that is locked out from their account for
  five minutes after entering too many wrong passwords can simply
  reboot to try again. (LP: #1383086)
* Fix the fact that a user that is locked out from their account for
  five minutes after entering too many wrong passwords can simply
  reboot to try again. (LP: #1383086)
[ Michael Zanetti ]
* Implement progressive autoscrolling in desktop spread
* add an animation transition when invoking the spread by hitting the
  right edge
[ Michael Zanetti ]
* release for wily
[ CI Train Bot ]
* New rebuild forced.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
{
75
75
    if (m_demoEdges != demoEdges) {
76
76
        m_demoEdges = demoEdges;
77
 
        m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
 
77
        m_service->setUserProperty(m_user, QStringLiteral("com.canonical.unity.AccountsService"), QStringLiteral("demo-edges"), demoEdges);
78
78
 
79
79
        Q_EMIT demoEdgesChanged();
80
80
    }
114
114
{
115
115
    if (m_hereEnabled != enabled) {
116
116
        m_hereEnabled = enabled;
117
 
        m_service->setUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseAccepted", enabled);
 
117
        m_service->setUserProperty(m_user, QStringLiteral("com.ubuntu.location.providers.here.AccountsService"), QStringLiteral("LicenseAccepted"), enabled);
118
118
 
119
119
        Q_EMIT hereEnabledChanged();
120
120
    }
133
133
void AccountsService::updateDemoEdges(bool async)
134
134
{
135
135
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
136
 
                                                                    "com.canonical.unity.AccountsService",
137
 
                                                                    "demo-edges");
 
136
                                                                    QStringLiteral("com.canonical.unity.AccountsService"),
 
137
                                                                    QStringLiteral("demo-edges"));
138
138
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
139
139
 
140
140
    connect(watcher, &QDBusPendingCallWatcher::finished,
162
162
void AccountsService::updateEnableLauncherWhileLocked(bool async)
163
163
{
164
164
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
165
 
                                                                    "com.ubuntu.AccountsService.SecurityPrivacy",
166
 
                                                                    "EnableLauncherWhileLocked");
 
165
                                                                    QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
 
166
                                                                    QStringLiteral("EnableLauncherWhileLocked"));
167
167
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
168
168
 
169
169
    connect(watcher, &QDBusPendingCallWatcher::finished,
191
191
void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
192
192
{
193
193
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
194
 
                                                                    "com.ubuntu.AccountsService.SecurityPrivacy",
195
 
                                                                    "EnableIndicatorsWhileLocked");
 
194
                                                                    QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
 
195
                                                                    QStringLiteral("EnableIndicatorsWhileLocked"));
196
196
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
197
197
 
198
198
    connect(watcher, &QDBusPendingCallWatcher::finished,
220
220
void AccountsService::updateBackgroundFile(bool async)
221
221
{
222
222
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
223
 
                                                                    "org.freedesktop.Accounts.User",
224
 
                                                                    "BackgroundFile");
 
223
                                                                    QStringLiteral("org.freedesktop.Accounts.User"),
 
224
                                                                    QStringLiteral("BackgroundFile"));
225
225
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
226
226
 
227
227
    connect(watcher, &QDBusPendingCallWatcher::finished,
249
249
void AccountsService::updateStatsWelcomeScreen(bool async)
250
250
{
251
251
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
252
 
                                                                    "com.ubuntu.touch.AccountsService.SecurityPrivacy",
253
 
                                                                    "StatsWelcomeScreen");
 
252
                                                                    QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy"),
 
253
                                                                    QStringLiteral("StatsWelcomeScreen"));
254
254
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
255
255
 
256
256
    connect(watcher, &QDBusPendingCallWatcher::finished,
278
278
void AccountsService::updatePasswordDisplayHint(bool async)
279
279
{
280
280
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
281
 
                                                                    "com.ubuntu.AccountsService.SecurityPrivacy",
282
 
                                                                    "PasswordDisplayHint");
 
281
                                                                    QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
 
282
                                                                    QStringLiteral("PasswordDisplayHint"));
283
283
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
284
284
 
285
285
    connect(watcher, &QDBusPendingCallWatcher::finished,
307
307
void AccountsService::updateFailedLogins(bool async)
308
308
{
309
309
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
310
 
                                                                    "com.canonical.unity.AccountsService.Private",
311
 
                                                                    "FailedLogins");
 
310
                                                                    QStringLiteral("com.canonical.unity.AccountsService.Private"),
 
311
                                                                    QStringLiteral("FailedLogins"));
312
312
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
313
313
 
314
314
    connect(watcher, &QDBusPendingCallWatcher::finished,
336
336
void AccountsService::updateHereEnabled(bool async)
337
337
{
338
338
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
339
 
                                                                    "com.ubuntu.location.providers.here.AccountsService",
340
 
                                                                    "LicenseAccepted");
 
339
                                                                    QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
 
340
                                                                    QStringLiteral("LicenseAccepted"));
341
341
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
342
342
 
343
343
    connect(watcher, &QDBusPendingCallWatcher::finished,
365
365
void AccountsService::updateHereLicensePath(bool async)
366
366
{
367
367
    QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
368
 
                                                                    "com.ubuntu.location.providers.here.AccountsService",
369
 
                                                                    "LicenseBasePath");
 
368
                                                                    QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
 
369
                                                                    QStringLiteral("LicenseBasePath"));
370
370
    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
371
371
 
372
372
    connect(watcher, &QDBusPendingCallWatcher::finished,
381
381
 
382
382
        QString hereLicensePath = reply.value().toString();
383
383
        if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
384
 
            hereLicensePath = "";
 
384
            hereLicensePath = QLatin1String("");
385
385
 
386
386
        if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
387
387
            m_hereLicensePath = hereLicensePath;
403
403
{
404
404
    if (m_failedLogins != failedLogins) {
405
405
        m_failedLogins = failedLogins;
406
 
        m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService.Private", "FailedLogins", failedLogins);
 
406
        m_service->setUserProperty(m_user, QStringLiteral("com.canonical.unity.AccountsService.Private"), QStringLiteral("FailedLogins"), failedLogins);
407
407
 
408
408
        Q_EMIT failedLoginsChanged();
409
409
    }
415
415
        return;
416
416
    }
417
417
 
418
 
    if (interface == "com.canonical.unity.AccountsService") {
419
 
        if (changed.contains("demo-edges")) {
 
418
    if (interface == QLatin1String("com.canonical.unity.AccountsService")) {
 
419
        if (changed.contains(QStringLiteral("demo-edges"))) {
420
420
            updateDemoEdges();
421
421
        }
422
 
    } else if (interface == "com.canonical.unity.AccountsService.Private") {
423
 
        if (changed.contains("FailedLogins")) {
 
422
    } else if (interface == QLatin1String("com.canonical.unity.AccountsService.Private")) {
 
423
        if (changed.contains(QStringLiteral("FailedLogins"))) {
424
424
            updateFailedLogins();
425
425
        }
426
 
    } else if (interface == "com.ubuntu.touch.AccountsService.SecurityPrivacy") {
427
 
        if (changed.contains("StatsWelcomeScreen")) {
 
426
    } else if (interface == QLatin1String("com.ubuntu.touch.AccountsService.SecurityPrivacy")) {
 
427
        if (changed.contains(QStringLiteral("StatsWelcomeScreen"))) {
428
428
            updateStatsWelcomeScreen();
429
429
        }
430
 
    } else if (interface == "com.ubuntu.AccountsService.SecurityPrivacy") {
431
 
        if (changed.contains("PasswordDisplayHint")) {
 
430
    } else if (interface == QLatin1String("com.ubuntu.AccountsService.SecurityPrivacy")) {
 
431
        if (changed.contains(QStringLiteral("PasswordDisplayHint"))) {
432
432
            updatePasswordDisplayHint();
433
433
        }
434
 
        if (changed.contains("EnableLauncherWhileLocked")) {
 
434
        if (changed.contains(QStringLiteral("EnableLauncherWhileLocked"))) {
435
435
            updateEnableLauncherWhileLocked();
436
436
        }
437
 
        if (changed.contains("EnableIndicatorsWhileLocked")) {
 
437
        if (changed.contains(QStringLiteral("EnableIndicatorsWhileLocked"))) {
438
438
            updateEnableIndicatorsWhileLocked();
439
439
        }
440
 
    } else if (interface == "com.ubuntu.location.providers.here.AccountsService") {
441
 
        if (changed.contains("LicenseAccepted")) {
 
440
    } else if (interface == QLatin1String("com.ubuntu.location.providers.here.AccountsService")) {
 
441
        if (changed.contains(QStringLiteral("LicenseAccepted"))) {
442
442
            updateHereEnabled();
443
443
        }
444
 
        if (changed.contains("LicenseBasePath")) {
 
444
        if (changed.contains(QStringLiteral("LicenseBasePath"))) {
445
445
            updateHereLicensePath();
446
446
        }
447
447
    }