summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorHarunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>2018-03-05 15:29:11 +0900
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-03-05 12:55:44 +0000
commit87a43c5dd1616f2d142d6bd499ead11825a347b4 (patch)
tree2bebf300bcf82181dd60024cb387558422ade241 /app/main.cpp
parentb58a69f9c960ac89f53a60416e1abb739a6f1b64 (diff)
Improve version information for AGL UCB.eel_5.0.2eel/5.0.25.0.2
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> (cherry picked from commit 5d2bb8dd6c20c74d66b320f407dd6221592ee25a) Change-Id: I3e2ba2abe5312945c567b9f501a2dd4f1f3453ce
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp11
1 files changed, 11 insertions, 0 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")));