Browse Source

Create helper function to get libtorrent version

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
d0e31adaf7
  1. 10
      src/app/stacktrace_win_dlg.h
  2. 8
      src/base/utils/misc.cpp
  3. 1
      src/base/utils/misc.h
  4. 3
      src/gui/about_imp.h

10
src/app/stacktrace_win_dlg.h

@ -32,7 +32,6 @@ @@ -32,7 +32,6 @@
#include <QString>
#include <QDialog>
#include "libtorrent/version.hpp"
#include "base/utils/misc.h"
#include "ui_stacktrace_win_dlg.h"
@ -62,13 +61,14 @@ public: @@ -62,13 +61,14 @@ 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<br/>"
"OS version: %2"
"Boost version: %2<br/>"
"OS version: %3"
"</font></p><br/>"
"<pre><code>%3</code></pre>"
"<pre><code>%4</code></pre>"
"<br/><hr><br/><br/>")
.arg(Utils::Misc::libtorrentVersionString())
.arg(Utils::Misc::boostVersionString())
.arg(Utils::Misc::osName())
.arg(trace);

8
src/base/utils/misc.cpp

@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
#include <QThread>
#include <QSysInfo>
#include <boost/version.hpp>
#include <libtorrent/version.hpp>
#ifdef DISABLE_GUI
#include <QCoreApplication>
@ -661,3 +662,10 @@ QString Utils::Misc::boostVersionString() @@ -661,3 +662,10 @@ QString Utils::Misc::boostVersionString()
.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;
}

1
src/base/utils/misc.h

@ -58,6 +58,7 @@ namespace Utils @@ -58,6 +58,7 @@ namespace Utils
#endif
QString osName();
QString boostVersionString();
QString libtorrentVersionString();
int pythonVersion();
QString pythonExecutable();

3
src/gui/about_imp.h

@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
#include "ui_about.h"
#include <QFile>
#include <libtorrent/version.hpp>
#include "base/utils/misc.h"
#include "base/unicodestrings.h"
@ -91,7 +90,7 @@ public: @@ -91,7 +90,7 @@ public:
// Libraries
label_11->setText(QT_VERSION_STR);
label_12->setText(LIBTORRENT_VERSION);
label_12->setText(Utils::Misc::libtorrentVersionString());
label_13->setText(Utils::Misc::boostVersionString());
show();

Loading…
Cancel
Save