Merge lp:~mardy/ubuntu-system-settings-online-accounts/single-new-hook-1596843 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Needs review
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/single-new-hook-1596843
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 55 lines (+34/-0)
2 files modified
click-hooks/accounts.cpp (+7/-0)
tests/click-hooks/tst_online_accounts_hooks2.cpp (+27/-0)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/single-new-hook-1596843
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Pending
Online Accounts Pending
Review via email: mp+298503@code.launchpad.net

Commit message

Support single account providers in new hooks

Description of the change

Support single account providers in new hooks

To post a comment you must log in.

Unmerged revisions

369. By Alberto Mardegan

Support single account providers in new hooks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click-hooks/accounts.cpp'
2--- click-hooks/accounts.cpp 2015-11-30 09:54:01 +0000
3+++ click-hooks/accounts.cpp 2016-06-28 09:31:34 +0000
4@@ -304,6 +304,13 @@
5 elem.appendChild(doc.createTextNode(icon));
6 root.appendChild(elem);
7
8+ // single account
9+ if (json.value(QStringLiteral("single-account")).toBool()) {
10+ elem = doc.createElement(QStringLiteral("single-account"));
11+ elem.appendChild(doc.createTextNode("true"));
12+ root.appendChild(elem);
13+ }
14+
15 addProfile(doc);
16 addTranslations(doc);
17 addTemplate(doc, json);
18
19=== modified file 'tests/click-hooks/tst_online_accounts_hooks2.cpp'
20--- tests/click-hooks/tst_online_accounts_hooks2.cpp 2015-11-30 09:54:01 +0000
21+++ tests/click-hooks/tst_online_accounts_hooks2.cpp 2016-06-28 09:31:34 +0000
22@@ -581,6 +581,33 @@
23 "}" <<
24 package <<
25 files;
26+
27+ package["myapp/Main.qml"] = "Something here";
28+ files.clear();
29+ files["providers/com.ubuntu.test_MyApp.provider"] =
30+ QString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
31+ "<!--this file is auto-generated by online-accounts-hooks2; do not modify-->\n"
32+ "<provider id=\"com.ubuntu.test_MyApp\">\n"
33+ " <name>Google</name>\n"
34+ " <icon>google.svg</icon>\n"
35+ " <single-account>true</single-account>\n"
36+ " <profile>com.ubuntu.test_MyApp_0.2</profile>\n"
37+ " <package-dir>/tmp/hooks-test2/package</package-dir>\n"
38+ "</provider>\n");
39+ files["qml-plugins/com.ubuntu.test_MyApp/Main.qml"] =
40+ "Something here";
41+ QTest::newRow("account plugin, single account") <<
42+ "com.ubuntu.test_MyApp_0.2.accounts" <<
43+ "{"
44+ " \"plugin\": {"
45+ " \"name\": \"Google\","
46+ " \"icon\": \"google.svg\","
47+ " \"single-account\": true,"
48+ " \"qml\": \"myapp\""
49+ " }"
50+ "}" <<
51+ package <<
52+ files;
53 }
54
55 void OnlineAccountsHooksTest::testValidHooks()

Subscribers

People subscribed via source and target branches