mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Create helper function to get OS name
This commit is contained in:
parent
7b2fab411c
commit
498f5e3877
@ -34,6 +34,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "boost/version.hpp"
|
#include "boost/version.hpp"
|
||||||
#include "libtorrent/version.hpp"
|
#include "libtorrent/version.hpp"
|
||||||
|
#include "base/utils/misc.h"
|
||||||
#include "ui_stacktrace_win_dlg.h"
|
#include "ui_stacktrace_win_dlg.h"
|
||||||
|
|
||||||
class StraceDlg : public QDialog, private Ui::errorDialog
|
class StraceDlg : public QDialog, private Ui::errorDialog
|
||||||
@ -67,13 +68,15 @@ public:
|
|||||||
"qBittorrent version: " VERSION "<br/>"
|
"qBittorrent version: " VERSION "<br/>"
|
||||||
"Libtorrent version: " LIBTORRENT_VERSION "<br/>"
|
"Libtorrent version: " LIBTORRENT_VERSION "<br/>"
|
||||||
"Qt version: " QT_VERSION_STR "<br/>"
|
"Qt version: " QT_VERSION_STR "<br/>"
|
||||||
"Boost version: %1.%2.%3"
|
"Boost version: %1.%2.%3<br/>"
|
||||||
|
"OS version: %4"
|
||||||
"</font></p><br/>"
|
"</font></p><br/>"
|
||||||
"<pre><code>%4</code></pre>"
|
"<pre><code>%5</code></pre>"
|
||||||
"<br/><hr><br/><br/>")
|
"<br/><hr><br/><br/>")
|
||||||
.arg(boostVerMajor)
|
.arg(boostVerMajor)
|
||||||
.arg(boostVerMinor)
|
.arg(boostVerMinor)
|
||||||
.arg(boostVerSubMin)
|
.arg(boostVerSubMin)
|
||||||
|
.arg(Utils::Misc::osName())
|
||||||
.arg(trace);
|
.arg(trace);
|
||||||
|
|
||||||
errorText->setHtml(htmlStr);
|
errorText->setHtml(htmlStr);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QSysInfo>
|
||||||
|
|
||||||
#ifdef DISABLE_GUI
|
#ifdef DISABLE_GUI
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@ -634,3 +635,18 @@ QSize Utils::Misc::smallIconSize()
|
|||||||
return QSize(s, s);
|
return QSize(s, s);
|
||||||
}
|
}
|
||||||
#endif
|
#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;
|
||||||
|
}
|
||||||
|
@ -56,6 +56,8 @@ namespace Utils
|
|||||||
QPoint screenCenter(QWidget *win);
|
QPoint screenCenter(QWidget *win);
|
||||||
QSize smallIconSize();
|
QSize smallIconSize();
|
||||||
#endif
|
#endif
|
||||||
|
QString osName();
|
||||||
|
|
||||||
int pythonVersion();
|
int pythonVersion();
|
||||||
QString pythonExecutable();
|
QString pythonExecutable();
|
||||||
QString pythonVersionComplete();
|
QString pythonVersionComplete();
|
||||||
|
Loading…
Reference in New Issue
Block a user