summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>2018-03-05 15:29:11 +0900
committerHarunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>2018-03-05 15:32:57 +0900
commit5d2bb8dd6c20c74d66b320f407dd6221592ee25a (patch)
tree8103d1dd2b8c577bc09b349e23cf462120ac8015
parentb50f32e75fbaf26a4906e43265c9d1d8579743ae (diff)
Improve version information for AGL UCB.
Version information is hardcoded. This commit support AGL UCB version automatically from /etc/os-release Bug-AGL: SPEC-656 Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
-rw-r--r--app/main.cpp11
-rw-r--r--app/version/Version.qml2
2 files changed, 12 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp
index d496ef6..3b0d1e9 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -133,6 +133,17 @@ int main(int argc, char *argv[])
} else {
qWarning() << version.errorString();
}
+
+ QFile aglversion("/etc/os-release");
+ if (aglversion.open(QFile::ReadOnly)) {
+ QStringList data = QString::fromLocal8Bit(aglversion.readAll()).split(QLatin1Char('\n'));
+ QStringList data2 = data.at(2).split(QLatin1Char('"'));
+ engine.rootContext()->setContextProperty("ucb", data2.at(1));
+ aglversion.close();
+ } else {
+ qWarning() << aglversion.errorString();
+ }
+
DBus dbus;
engine.rootContext()->setContextProperty("dbus", &dbus);
engine.load(QUrl(QStringLiteral("qrc:/Settings.qml")));
diff --git a/app/version/Version.qml b/app/version/Version.qml
index 228481f..8d47ad5 100644
--- a/app/version/Version.qml
+++ b/app/version/Version.qml
@@ -55,7 +55,7 @@ SettingPage {
font.pixelSize: 48
}
Label {
- text: '5.0.0rc2 (Electric Eel)'
+ text: ucb
font.pixelSize: 48
Layout.fillWidth: true
}