mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Create helper function to get OS name
This commit is contained in:
parent
7b2fab411c
commit
498f5e3877
3 changed files with 23 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue