Merge lp:~michihenning/storage-framework/add-local-to-registry into lp:storage-framework/devel

Proposed by Michi Henning
Status: Merged
Approved by: James Henstridge
Approved revision: 119
Merged at revision: 116
Proposed branch: lp:~michihenning/storage-framework/add-local-to-registry
Merge into: lp:storage-framework/devel
Diff against target: 52 lines (+18/-0)
2 files modified
src/registry/CMakeLists.txt (+2/-0)
src/registry/internal/ListAccountsHandler.cpp (+16/-0)
To merge this branch: bzr merge lp:~michihenning/storage-framework/add-local-to-registry
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
James Henstridge Approve
Review via email: mp+320138@code.launchpad.net

Commit message

Add entry for local provider to list of accounts returned by registry.

Description of the change

Add entry for local provider to list of accounts returned by registry.

To post a comment you must log in.
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good. Placing the local provider at the end should keep any code that was using the "pick the first account" working as before.

review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:119
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/265/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1813
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1820
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1596/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1596/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1596/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1596/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1596/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1596
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1596/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/265/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/registry/CMakeLists.txt'
2--- src/registry/CMakeLists.txt 2016-11-21 04:24:13 +0000
3+++ src/registry/CMakeLists.txt 2017-03-17 06:32:30 +0000
4@@ -1,5 +1,6 @@
5 include_directories(
6 ${CMAKE_CURRENT_BINARY_DIR}
7+ ${GLIB_DEPS_INCLUDE_DIRS}
8 ${ONLINEACCOUNTS_DEPS_INCLUDE_DIRS}
9 )
10
11@@ -31,6 +32,7 @@
12 storage-framework-common-internal
13 Qt5::Core
14 Qt5::DBus
15+ ${GLIB_DEPS_LDFLAGS}
16 ${ONLINEACCOUNTS_DEPS_LDFLAGS}
17 )
18
19
20=== modified file 'src/registry/internal/ListAccountsHandler.cpp'
21--- src/registry/internal/ListAccountsHandler.cpp 2017-01-13 04:03:12 +0000
22+++ src/registry/internal/ListAccountsHandler.cpp 2017-03-17 06:32:30 +0000
23@@ -21,6 +21,11 @@
24 #include <unity/storage/internal/AccountDetails.h>
25 #include <unity/storage/registry/internal/qdbus-last-error-msg.h>
26
27+#pragma GCC diagnostic push
28+#pragma GCC diagnostic ignored "-Wold-style-cast"
29+#include <glib.h>
30+#pragma GCC diagnostic pop
31+
32 #include <OnlineAccounts/Account>
33 #include <QDebug>
34
35@@ -100,6 +105,17 @@
36 accounts.append(ad);
37 }
38
39+ // Add an entry for the local provider, which Online Accounts doesn't know about.
40+ storage::internal::AccountDetails ad;
41+ ad.busName = "com.canonical.StorageFramework.Provider.Local";
42+ ad.objectPath = QDBusObjectPath(QStringLiteral("/provider/0"));
43+ ad.id = 0;
44+ ad.serviceId = g_get_user_name();
45+ ad.displayName = "Local Provider";
46+ ad.providerName = "Local Provider";
47+ ad.iconName = "";
48+ accounts.append(ad);
49+
50 if (!conn_.send(msg_.createReply(QVariant::fromValue(accounts))))
51 {
52 auto msg = last_error_msg(conn_);

Subscribers

People subscribed via source and target branches

to all changes: