mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Merge pull request #4865 from Chocobo1/os_name
Shorten crash report on windows
This commit is contained in:
commit
56605cd0c3
@ -259,9 +259,9 @@ const QString straceWin::getBacktrace()
|
||||
}
|
||||
}
|
||||
|
||||
logStream << "\n\nList of linked Modules:\n";
|
||||
EnumModulesContext modulesContext(hProcess, logStream);
|
||||
SymEnumerateModules64(hProcess, EnumModulesCB, (PVOID)&modulesContext);
|
||||
//logStream << "\n\nList of linked Modules:\n";
|
||||
//EnumModulesContext modulesContext(hProcess, logStream);
|
||||
//SymEnumerateModules64(hProcess, EnumModulesCB, (PVOID)&modulesContext);
|
||||
logStream << "```";
|
||||
return log;
|
||||
}
|
||||
|
@ -32,8 +32,7 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QDialog>
|
||||
#include "boost/version.hpp"
|
||||
#include "libtorrent/version.hpp"
|
||||
#include "base/utils/misc.h"
|
||||
#include "ui_stacktrace_win_dlg.h"
|
||||
|
||||
class StraceDlg : public QDialog, private Ui::errorDialog
|
||||
@ -50,9 +49,6 @@ public:
|
||||
void setStacktraceString(const QString& trace)
|
||||
{
|
||||
// try to call Qt function as less as possible
|
||||
const int boostVerMajor = BOOST_VERSION / 100000;
|
||||
const int boostVerMinor = ((BOOST_VERSION / 100) % 1000);
|
||||
const int boostVerSubMin = BOOST_VERSION % 100;
|
||||
QString htmlStr = QString(
|
||||
"<p align=center><b><font size=7 color=red>"
|
||||
"qBittorrent has crashed"
|
||||
@ -65,15 +61,16 @@ public:
|
||||
"<br/><hr><br/>"
|
||||
"<p align=center><font size=4>"
|
||||
"qBittorrent version: " VERSION "<br/>"
|
||||
"Libtorrent version: " LIBTORRENT_VERSION "<br/>"
|
||||
"Libtorrent version: %1<br/>"
|
||||
"Qt version: " QT_VERSION_STR "<br/>"
|
||||
"Boost version: %1.%2.%3"
|
||||
"Boost version: %2<br/>"
|
||||
"OS version: %3"
|
||||
"</font></p><br/>"
|
||||
"<pre><code>%4</code></pre>"
|
||||
"<br/><hr><br/><br/>")
|
||||
.arg(boostVerMajor)
|
||||
.arg(boostVerMinor)
|
||||
.arg(boostVerSubMin)
|
||||
.arg(Utils::Misc::libtorrentVersionString())
|
||||
.arg(Utils::Misc::boostVersionString())
|
||||
.arg(Utils::Misc::osName())
|
||||
.arg(trace);
|
||||
|
||||
errorText->setHtml(htmlStr);
|
||||
|
@ -37,6 +37,9 @@
|
||||
#include <QProcess>
|
||||
#include <QSettings>
|
||||
#include <QThread>
|
||||
#include <QSysInfo>
|
||||
#include <boost/version.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
#include <QCoreApplication>
|
||||
@ -634,3 +637,35 @@ 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;
|
||||
}
|
||||
|
||||
QString Utils::Misc::boostVersionString()
|
||||
{
|
||||
// static initialization for usage in signal handler
|
||||
static const QString ver = QString("%1.%2.%3")
|
||||
.arg(BOOST_VERSION / 100000)
|
||||
.arg((BOOST_VERSION / 100) % 1000)
|
||||
.arg(BOOST_VERSION % 100);
|
||||
return ver;
|
||||
}
|
||||
|
||||
QString Utils::Misc::libtorrentVersionString()
|
||||
{
|
||||
// static initialization for usage in signal handler
|
||||
static const QString ver = LIBTORRENT_VERSION;
|
||||
return ver;
|
||||
}
|
||||
|
@ -57,6 +57,10 @@ namespace Utils
|
||||
QPoint screenCenter(QWidget *win);
|
||||
QSize smallIconSize();
|
||||
#endif
|
||||
QString osName();
|
||||
QString boostVersionString();
|
||||
QString libtorrentVersionString();
|
||||
|
||||
int pythonVersion();
|
||||
QString pythonExecutable();
|
||||
QString pythonVersionComplete();
|
||||
|
@ -33,8 +33,7 @@
|
||||
|
||||
#include "ui_about.h"
|
||||
#include <QFile>
|
||||
#include <libtorrent/version.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/unicodestrings.h"
|
||||
|
||||
class about: public QDialog, private Ui::AboutDlg
|
||||
@ -91,8 +90,8 @@ public:
|
||||
|
||||
// Libraries
|
||||
label_11->setText(QT_VERSION_STR);
|
||||
label_12->setText(LIBTORRENT_VERSION);
|
||||
label_13->setText(QString::number(BOOST_VERSION / 100000) + "." + QString::number((BOOST_VERSION / 100) % 1000) + "." + QString::number(BOOST_VERSION % 100));
|
||||
label_12->setText(Utils::Misc::libtorrentVersionString());
|
||||
label_13->setText(Utils::Misc::boostVersionString());
|
||||
|
||||
show();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user