summaryrefslogtreecommitdiffstats
path: root/src/systeminfo/linux/qdeviceinfo_linux.cpp
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@ktknet.cz>2014-03-05 10:10:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-23 20:41:46 +0100
commit2a2e7b27f92f19507330fd3064b8e1c6294eeb04 (patch)
treefc13eb291f521ab3915b052a5a0250e8695f4df5 /src/systeminfo/linux/qdeviceinfo_linux.cpp
parent637a272f137f363ead5eacc5410ffc7b6d747ba5 (diff)
Prefer VERSION_ID from /etc/os-release as QDeviceInfo::Os
On Sailfish OS, where /etc/hw-release exists, QDeviceInfo::version() used to wrongly return hardware adaptation VERSION_ID from that file as the first value discovered by QDeviceInfoPrivate::findInRelease(). Thus, we look into /etc/os-release first. If the version isn't found, the method resorts to the previous behavior. Change-Id: Ia10c5d7b9cff83ab3006253931ca5a79f2e7c65f Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/systeminfo/linux/qdeviceinfo_linux.cpp')
-rw-r--r--src/systeminfo/linux/qdeviceinfo_linux.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systeminfo/linux/qdeviceinfo_linux.cpp b/src/systeminfo/linux/qdeviceinfo_linux.cpp
index c86631c9..b77653d0 100644
--- a/src/systeminfo/linux/qdeviceinfo_linux.cpp
+++ b/src/systeminfo/linux/qdeviceinfo_linux.cpp
@@ -409,6 +409,11 @@ QString QDeviceInfoPrivate::version(QDeviceInfo::Version type)
case QDeviceInfo::Os:
if (versionBuffer[0].isEmpty()) {
+ versionBuffer[0] = findInRelease(QStringLiteral("VERSION_ID"),
+ QStringLiteral("os-release"));
+ }
+
+ if (versionBuffer[0].isEmpty()) {
versionBuffer[0] = findInRelease(QStringLiteral("VERSION_ID"));
}