#5603 Ignore exceptions in getOSInformation()
This commit is contained in:
parent
088ac82e18
commit
02d75cd370
|
@ -114,15 +114,18 @@ QString getOSInformation()
|
||||||
QString result;
|
QString result;
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
QStringList arguments;
|
result = "Linux";
|
||||||
arguments.append("/etc/os-release");
|
try {
|
||||||
CommandProcess cp("/bin/cat", arguments);
|
QStringList arguments;
|
||||||
QString output = cp.run();
|
arguments.append("/etc/os-release");
|
||||||
|
CommandProcess cp("/bin/cat", arguments);
|
||||||
|
QString output = cp.run();
|
||||||
|
|
||||||
QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*");
|
QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*");
|
||||||
if (resultRegex.exactMatch(output)) {
|
if (resultRegex.exactMatch(output)) {
|
||||||
QString OSInfo = resultRegex.cap(1);
|
result = resultRegex.cap(1);
|
||||||
result = OSInfo;
|
}
|
||||||
|
} catch (...) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue