Browse Source

Merge pull request #4865 from Chocobo1/os_name

Shorten crash report on windows
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
56605cd0c3
  1. 6
      src/app/stacktrace_win.h
  2. 17
      src/app/stacktrace_win_dlg.h
  3. 35
      src/base/utils/misc.cpp
  4. 4
      src/base/utils/misc.h
  5. 7
      src/gui/about_imp.h

6
src/app/stacktrace_win.h

@ -259,9 +259,9 @@ const QString straceWin::getBacktrace() @@ -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;
}

17
src/app/stacktrace_win_dlg.h

@ -32,8 +32,7 @@ @@ -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: @@ -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: @@ -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);

35
src/base/utils/misc.cpp

@ -37,6 +37,9 @@ @@ -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() @@ -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;
}

4
src/base/utils/misc.h

@ -57,6 +57,10 @@ namespace Utils @@ -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();

7
src/gui/about_imp.h

@ -33,8 +33,7 @@ @@ -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: @@ -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…
Cancel
Save