Create helper function to get OS name

This commit is contained in:
Chocobo1 2016-02-27 05:48:53 +08:00 committed by sledgehammer999
commit e3c9488fb0
3 changed files with 23 additions and 2 deletions

View file

@ -37,6 +37,7 @@
#include <QProcess>
#include <QSettings>
#include <QThread>
#include <QSysInfo>
#ifdef DISABLE_GUI
#include <QCoreApplication>
@ -634,3 +635,18 @@ QSize Utils::Misc::smallIconSize()
return QSize(s, s);
}
#endif
QString Utils::Misc::osName()
{
// static initialization for usage in signal handler
static const QString name =
#ifdef QBT_USES_QT5
QString("%1 %2 %3")
.arg(QSysInfo::prettyProductName())
.arg(QSysInfo::kernelVersion())
.arg(QSysInfo::currentCpuArchitecture());
#else
"<Input OS name here>";
#endif
return name;
}

View file

@ -56,6 +56,8 @@ namespace Utils
QPoint screenCenter(QWidget *win);
QSize smallIconSize();
#endif
QString osName();
int pythonVersion();
QString pythonExecutable();
QString pythonVersionComplete();