Merge lp:~jonas-drange/ubuntu-system-settings/visible-file-exists-vivid into lp:ubuntu-system-settings/15.04

Proposed by Jonas G. Drange
Status: Merged
Approved by: Ken VanDine
Approved revision: 1417
Merged at revision: 1429
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/visible-file-exists-vivid
Merge into: lp:ubuntu-system-settings/15.04
Diff against target: 74 lines (+13/-2)
5 files modified
debian/control (+1/-1)
lib/SystemSettings/item-base.cpp (+1/-0)
lib/SystemSettings/item-base.h (+1/-0)
plugins/system-update/system-update.settings (+4/-1)
src/plugin.cpp (+6/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/visible-file-exists-vivid
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+261619@code.launchpad.net

Commit message

define a way for plugin to be visible if a file exists, use that capability
to enable the updates panel on system-image systems and not snappy one,
which allows us to not have a strong depends on system image components

Description of the change

define a way for plugin to be visible if a file exists, use that capability
to enable the updates panel on system-image systems and not snappy one,
which allows us to not have a strong depends on system image components

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

The system-image-snappy-cli probably won't go into vivid, but no harm in including the "or" depends here to keep it out of the delta between wily and vivid.

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-04-30 19:35:35 +0000
3+++ debian/control 2015-06-10 13:33:49 +0000
4@@ -79,7 +79,7 @@
5 suru-icon-theme,
6 whoopsie-preferences (>= 0.9),
7 libsystemsettings1 (= ${binary:Version}),
8- system-image-dbus (>= 2.5),
9+ system-image-dbus (>= 2.5) | system-image-snappy-cli,
10 click,
11 ubuntu-keyboard-data (>= 0.99.trunk.phablet2+13.10.20131001),
12 urfkill,
13
14=== modified file 'lib/SystemSettings/item-base.cpp'
15--- lib/SystemSettings/item-base.cpp 2013-09-12 11:17:35 +0000
16+++ lib/SystemSettings/item-base.cpp 2015-06-10 13:33:49 +0000
17@@ -40,6 +40,7 @@
18 const QLatin1String keyHasDynamicKeywords("has-dynamic-keywords");
19 const QLatin1String keyHasDynamicVisibility("has-dynamic-visibility");
20 const QLatin1String keyHideByDefault("hide-by-default");
21+const QLatin1String keyVisibleIfFileExists("visible-if-file-exists");
22
23 class ItemBasePrivate
24 {
25
26=== modified file 'lib/SystemSettings/item-base.h'
27--- lib/SystemSettings/item-base.h 2014-10-27 13:28:49 +0000
28+++ lib/SystemSettings/item-base.h 2015-06-10 13:33:49 +0000
29@@ -40,6 +40,7 @@
30 extern const QLatin1String keyHasDynamicKeywords;
31 extern const QLatin1String keyHasDynamicVisibility;
32 extern const QLatin1String keyHideByDefault;
33+extern const QLatin1String keyVisibleIfFileExists;
34
35 class ItemBasePrivate;
36 class ItemBase: public QObject
37
38=== modified file 'plugins/system-update/system-update.settings'
39--- plugins/system-update/system-update.settings 2014-09-24 17:10:03 +0000
40+++ plugins/system-update/system-update.settings 2015-06-10 13:33:49 +0000
41@@ -9,6 +9,7 @@
42 "software",
43 "update",
44 "apps",
45+ "application",
46 "automatic",
47 "download",
48 "upgrade",
49@@ -16,5 +17,7 @@
50 ],
51 "has-dynamic-keywords": false,
52 "has-dynamic-visibility": false,
53- "page-component": "PageComponent.qml"
54+ "page-component": "PageComponent.qml",
55+ "visible-if-file-exists": "/usr/share/dbus-1/system-services/com.canonical.SystemImage.service"
56 }
57+
58
59=== modified file 'src/plugin.cpp'
60--- src/plugin.cpp 2014-10-27 13:29:30 +0000
61+++ src/plugin.cpp 2015-06-10 13:33:49 +0000
62@@ -220,6 +220,12 @@
63 bool Plugin::isVisible() const
64 {
65 Q_D(const Plugin);
66+ if (!d->m_data.value(keyVisibleIfFileExists).isNull()) {
67+ QFile KeyFile(d->m_data.value(keyVisibleIfFileExists).toString());
68+ if (!KeyFile.exists())
69+ return false;
70+ }
71+
72 // TODO: visibility check depending on form-factor
73 if (d->m_data.value(keyHasDynamicVisibility).toBool()) {
74 if (!d->ensureLoaded()) return false;

Subscribers

People subscribed via source and target branches