From 4f4f435e76de5eabe93ebfe61b971e86b94acfb7 Mon Sep 17 00:00:00 2001 From: silverqx Date: Mon, 10 Jun 2019 19:14:59 +0200 Subject: [PATCH] Add zlib version to GUI & stackdump --- src/app/stacktracedialog.h | 8 +++++--- src/base/utils/misc.cpp | 8 ++++++++ src/base/utils/misc.h | 1 + src/gui/aboutdialog.h | 1 + src/gui/aboutdialog.ui | 20 ++++++++++++++++++++ src/webui/api/appcontroller.cpp | 1 + src/webui/www/private/about.html | 5 +++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/app/stacktracedialog.h b/src/app/stacktracedialog.h index ff9b0c81e..96292093f 100644 --- a/src/app/stacktracedialog.h +++ b/src/app/stacktracedialog.h @@ -72,15 +72,17 @@ public: "Qt version: " QT_VERSION_STR "
" "Boost version: %3
" "OpenSSL version: %4
" - "OS version: %5

" - "Caught signal: %6" + "zlib version: %5
" + "OS version: %6

" + "Caught signal: %7" "

" - "
%7
" + "
%8
" "



") .arg(QString::number(QT_POINTER_SIZE * 8) , Utils::Misc::libtorrentVersionString() , Utils::Misc::boostVersionString() , Utils::Misc::opensslVersionString() + , Utils::Misc::zlibVersionString() , Utils::Misc::osName() , sigName , trace); diff --git a/src/base/utils/misc.cpp b/src/base/utils/misc.cpp index 6514abf8f..3941bc28e 100644 --- a/src/base/utils/misc.cpp +++ b/src/base/utils/misc.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -463,6 +464,13 @@ QString Utils::Misc::opensslVersionString() return version.split(' ', QString::SkipEmptyParts)[1]; } +QString Utils::Misc::zlibVersionString() +{ + // static initialization for usage in signal handler + static const QString version {ZLIB_VERSION}; + return version; +} + #ifdef Q_OS_WIN QString Utils::Misc::windowsSystemPath() { diff --git a/src/base/utils/misc.h b/src/base/utils/misc.h index 539df3048..c83918ed0 100644 --- a/src/base/utils/misc.h +++ b/src/base/utils/misc.h @@ -70,6 +70,7 @@ namespace Utils QString boostVersionString(); QString libtorrentVersionString(); QString opensslVersionString(); + QString zlibVersionString(); QString unitString(SizeUnit unit, bool isSpeed = false); diff --git a/src/gui/aboutdialog.h b/src/gui/aboutdialog.h index 7ab927f2f..a41bc9a02 100644 --- a/src/gui/aboutdialog.h +++ b/src/gui/aboutdialog.h @@ -99,6 +99,7 @@ public: m_ui->labelLibtVer->setText(Utils::Misc::libtorrentVersionString()); m_ui->labelBoostVer->setText(Utils::Misc::boostVersionString()); m_ui->labelOpensslVer->setText(Utils::Misc::opensslVersionString()); + m_ui->labelZlibVer->setText(Utils::Misc::zlibVersionString()); Utils::Gui::resize(this); show(); diff --git a/src/gui/aboutdialog.ui b/src/gui/aboutdialog.ui index 2fb89da29..f0ed552d6 100644 --- a/src/gui/aboutdialog.ui +++ b/src/gui/aboutdialog.ui @@ -441,6 +441,26 @@ + + + + zlib: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 0cf80dc00..bbaf36c6b 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -71,6 +71,7 @@ void AppController::buildInfoAction() {"libtorrent", Utils::Misc::libtorrentVersionString()}, {"boost", Utils::Misc::boostVersionString()}, {"openssl", Utils::Misc::opensslVersionString()}, + {"zlib", Utils::Misc::zlibVersionString()}, {"bitness", (QT_POINTER_SIZE * 8)} }; setResult(versions); diff --git a/src/webui/www/private/about.html b/src/webui/www/private/about.html index e2f783c12..b540b9146 100644 --- a/src/webui/www/private/about.html +++ b/src/webui/www/private/about.html @@ -671,6 +671,10 @@ OpenSSL: + + zlib: + + @@ -691,6 +695,7 @@ $('libtorrentVersion').textContent = info.libtorrent; $('boostVersion').textContent = info.boost; $('opensslVersion').textContent = info.openssl; + $('zlibVersion').textContent = info.zlib; $('qbittorrentVersion').textContent += " (" + info.bitness + "-bit)"; } }).send();