From 98531870515d5b88ef25a8ffe7320de3993ed683 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 30 Nov 2015 19:53:19 +0300 Subject: [PATCH 1/2] Fix wrong encoding for listen failed error message. --- src/core/bittorrent/session.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/bittorrent/session.cpp b/src/core/bittorrent/session.cpp index b9171ca6e..0b7962170 100644 --- a/src/core/bittorrent/session.cpp +++ b/src/core/bittorrent/session.cpp @@ -1511,7 +1511,7 @@ void Session::setListeningPort() m_nativeSession->listen_on(ports, ec, 0, libt::session::listen_no_system_port); if (ec) - logger->addMessage(tr("qBittorrent failed to listen on any interface port: %1. Reason: %2", "e.g: qBittorrent failed to listen on any interface port: TCP/6881. Reason: no such interface" ).arg(QString::number(port)).arg(Utils::String::fromStdString(ec.message())), Log::CRITICAL); + logger->addMessage(tr("qBittorrent failed to listen on any interface port: %1. Reason: %2.", "e.g: qBittorrent failed to listen on any interface port: TCP/6881. Reason: no such interface" ).arg(QString::number(port)).arg(QString::fromLocal8Bit(ec.message().c_str())), Log::CRITICAL); return; } @@ -2304,10 +2304,10 @@ void Session::handleListenFailedAlert(libt::listen_failed_alert *p) proto = "SOCKS5"; qDebug() << "Failed listening on " << proto << p->endpoint.address().to_string(ec).c_str() << "/" << p->endpoint.port(); Logger::instance()->addMessage( - tr("qBittorrent failed listening on interface %1 port: %2/%3. Reason: %4", + tr("qBittorrent failed listening on interface %1 port: %2/%3. Reason: %4.", "e.g: qBittorrent failed listening on interface 192.168.0.1 port: TCP/6881. Reason: already in use") .arg(p->endpoint.address().to_string(ec).c_str()).arg(proto).arg(QString::number(p->endpoint.port())) - .arg(Utils::String::fromStdString(p->error.message())), Log::CRITICAL); + .arg(QString::fromLocal8Bit(p->error.message().c_str())), Log::CRITICAL); } void Session::handleExternalIPAlert(libt::external_ip_alert *p) From 6bf2c5a946a87045fd53734ea0bfc622f1738da1 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 30 Nov 2015 19:58:19 +0300 Subject: [PATCH 2/2] Remove unused LineEdit slot. Fix compiler warning. --- src/gui/lineedit/src/lineedit.cpp | 4 ++-- src/gui/lineedit/src/lineedit.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/lineedit/src/lineedit.cpp b/src/gui/lineedit/src/lineedit.cpp index 8de914ab0..78dc6870c 100644 --- a/src/gui/lineedit/src/lineedit.cpp +++ b/src/gui/lineedit/src/lineedit.cpp @@ -64,9 +64,9 @@ void LineEdit::resizeEvent(QResizeEvent *e) #endif } +#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) void LineEdit::updateCloseButton(const QString &text) { -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) clearButton->setVisible(!text.isEmpty()); -#endif } +#endif diff --git a/src/gui/lineedit/src/lineedit.h b/src/gui/lineedit/src/lineedit.h index 74ee9b423..84e0d5cf4 100644 --- a/src/gui/lineedit/src/lineedit.h +++ b/src/gui/lineedit/src/lineedit.h @@ -24,8 +24,10 @@ public: protected: void resizeEvent(QResizeEvent *e); +#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) private slots: void updateCloseButton(const QString &text); +#endif private: QToolButton *searchButton;