Merge lp:~seb128/ubuntu-system-settings/update-build-number into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 447
Merged at revision: 453
Proposed branch: lp:~seb128/ubuntu-system-settings/update-build-number
Merge into: lp:ubuntu-system-settings
Diff against target: 92 lines (+24/-1)
3 files modified
plugins/about/PageComponent.qml (+7/-1)
plugins/system-update/update.cpp (+12/-0)
plugins/system-update/update.h (+5/-0)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/update-build-number
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+190390@code.launchpad.net

Commit message

update: get the current build number, use it in the os version string

Description of the change

update: get the current build number, use it in the os version string

To post a comment you must log in.
445. By Sebastien Bacher

update: get the current build number, use it in the os version string

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hi Seb! I tested the change and it seems to work like a charm on the device. Just one question...

+ if (m_downloadMode != -1)
+ return m_currentBuildNumber;

Not sure if I understand this part? Shouldn't it be if (currentBuildNumber != -1) instead? Or is it related to download mode in some way? I might be wrong!

review: Needs Fixing
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

m_currentBuildNumber of course (m_ got eaten).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Łukasz, well spotted, indeed ... I copied another function as a basis and seems like I forgot that one!

446. By Sebastien Bacher

rebase on trunk

447. By Sebastien Bacher

use the correct variable name

Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, rebased on trunk, commit the fix and pushed the update ... should be good to review ;-)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Awesome!

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

did you mean to change the status as well?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/about/PageComponent.qml'
2--- plugins/about/PageComponent.qml 2013-09-12 11:18:44 +0000
3+++ plugins/about/PageComponent.qml 2013-10-11 11:57:00 +0000
4@@ -24,6 +24,7 @@
5 import Ubuntu.Components 0.1
6 import Ubuntu.Components.ListItems 0.1 as ListItem
7 import Ubuntu.SystemSettings.StorageAbout 1.0
8+import Ubuntu.SystemSettings.Update 1.0
9
10 ItemPage {
11 id: root
12@@ -39,6 +40,10 @@
13 id: deviceInfos
14 }
15
16+ UbuntuUpdatePanel {
17+ id: updateBackend
18+ }
19+
20 Flickable {
21 id: scrollWidget
22 anchors.fill: parent
23@@ -90,7 +95,8 @@
24
25 ListItem.SingleValue {
26 text: i18n.tr("OS")
27- value: "Ubuntu " + deviceInfos.version(DeviceInfo.Os)
28+ value: "Ubuntu " + deviceInfos.version(DeviceInfo.Os) +
29+ (updateBackend.currentBuildNumber ? " (r%1)".arg(updateBackend.currentBuildNumber) : "")
30 }
31
32 ListItem.SingleValue {
33
34=== modified file 'plugins/system-update/update.cpp'
35--- plugins/system-update/update.cpp 2013-09-30 10:51:36 +0000
36+++ plugins/system-update/update.cpp 2013-10-11 11:57:00 +0000
37@@ -36,6 +36,7 @@
38 QObject(parent),
39 m_infoMessage(""),
40 m_downloadMode(-1),
41+ m_currentBuildNumber(-1),
42 m_systemBusConnection (QDBusConnection::systemBus()),
43 m_SystemServiceIface ("com.canonical.SystemImage",
44 "/Service",
45@@ -102,6 +103,17 @@
46 Q_EMIT infoMessageChanged();
47 }
48
49+int Update::currentBuildNumber() {
50+ if (m_currentBuildNumber != -1)
51+ return m_currentBuildNumber;
52+
53+ QDBusReply<int> reply = m_SystemServiceIface.call("Info");
54+ if (reply.isValid())
55+ m_currentBuildNumber = reply.value();
56+
57+ return m_currentBuildNumber;
58+}
59+
60 int Update::DownloadMode() {
61 if (m_downloadMode != -1)
62 return m_downloadMode;
63
64=== modified file 'plugins/system-update/update.h'
65--- plugins/system-update/update.h 2013-09-30 15:02:34 +0000
66+++ plugins/system-update/update.h 2013-10-11 11:57:00 +0000
67@@ -39,6 +39,9 @@
68 READ DownloadMode
69 WRITE SetDownloadMode
70 NOTIFY downloadModeChanged)
71+ Q_PROPERTY( int currentBuildNumber
72+ READ currentBuildNumber
73+ CONSTANT)
74
75 public:
76 explicit Update(QObject *parent = 0);
77@@ -50,6 +53,7 @@
78 void SetInfoMessage(QString);
79 int DownloadMode();
80 void SetDownloadMode(int);
81+ int currentBuildNumber();
82
83 Q_INVOKABLE void CheckForUpdate();
84 Q_INVOKABLE void DownloadUpdate();
85@@ -76,6 +80,7 @@
86 private:
87 QString m_infoMessage;
88 int m_downloadMode;
89+ int m_currentBuildNumber;
90
91 QDBusConnection m_systemBusConnection;
92 QString m_objectPath;

Subscribers

People subscribed via source and target branches