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