diff options
-rw-r--r-- | subsurfacesysinfo.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/subsurfacesysinfo.cpp b/subsurfacesysinfo.cpp index 2458d2880..4a55e7315 100644 --- a/subsurfacesysinfo.cpp +++ b/subsurfacesysinfo.cpp @@ -44,6 +44,7 @@ #include <QString> #include <QFile> #include <QSettings> +#include <QTextStream> #ifndef QStringLiteral # define QStringLiteral QString::fromUtf8 @@ -234,6 +235,26 @@ static bool readEtcOsRelease(QUnixOSVersion &v) } return true; } + QFile lsbRelease("/etc/lsb-release"); + if (lsbRelease.exists()) { + QSettings parse("/etc/lsb-release", QSettings::IniFormat); + if (parse.contains("DISTRIB_DESCRIPTION")) { + v.versionText = parse.value("DISTRIB_DESCRIPTION").toString(); + if (v.versionText == "PCLinuxOS") { + QFile release("/etc/release"); + if (release.exists()) { + if (release.open(QFile::ReadOnly | QFile::Text)) { + QTextStream in(&release); + v.versionText = in.readAll(); + // need to get rid of the redundant text after '(' + int i = v.versionText.indexOf('('); + v.versionText.remove(i, 1000); + } + } + } + } + return true; + } return false; } #endif // USE_ETC_OS_RELEASE |