From 551ffb88abddf2b9224b33bd4a1000ba68b9c158 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 28 Aug 2017 13:02:46 +0800 Subject: [PATCH] Define QT_USE_QSTRINGBUILDER. The old defines are deprecated. QT_USE_QSTRINGBUILDER also supports QByteArray which we use extensively in WebUI. --- src/CMakeLists.txt | 4 ++-- src/base/net/smtp.cpp | 12 ++++++------ src/gui/properties/trackersadditiondlg.cpp | 2 +- src/src.pro | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3137057ca..4c8f38d31 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,8 +40,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # defines add_definitions(-DQT_NO_CAST_TO_ASCII) -# Fast concatenation (Qt >= 4.6) -add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) +# Efficient construction for QString & QByteArray (Qt >= 4.8) +add_definitions(-DQT_USE_QSTRINGBUILDER) if (WIN32) add_definitions(-DNOMINMAX) endif (WIN32) diff --git a/src/base/net/smtp.cpp b/src/base/net/smtp.cpp index fcc35b2e3..5a9f203cb 100644 --- a/src/base/net/smtp.cpp +++ b/src/base/net/smtp.cpp @@ -194,7 +194,7 @@ void Smtp::readyRead() ehlo(); } else { - logError("Connection failed, unrecognized reply: " + line); + logError(QLatin1String("Connection failed, unrecognized reply: ") + line); m_state = Close; } break; @@ -231,7 +231,7 @@ void Smtp::readyRead() } else { // Authentication failed! - logError("Authentication failed, msg: " + line); + logError(QLatin1String("Authentication failed, msg: ") + line); m_state = Close; } break; @@ -242,7 +242,7 @@ void Smtp::readyRead() m_state = Data; } else { - logError(" was rejected by server, msg: " + line); + logError(QLatin1String(" was rejected by server, msg: ") + line); m_state = Close; } break; @@ -253,7 +253,7 @@ void Smtp::readyRead() m_state = Body; } else { - logError(" was rejected by server, msg: " + line); + logError(QLatin1String(" was rejected by server, msg: ") + line); m_state = Close; } break; @@ -264,7 +264,7 @@ void Smtp::readyRead() m_state = Quit; } else { - logError(" was rejected by server, msg: " + line); + logError(QLatin1String(" was rejected by server, msg: ") + line); m_state = Close; } break; @@ -276,7 +276,7 @@ void Smtp::readyRead() m_state = Close; } else { - logError("Message was rejected by the server, error: " + line); + logError(QLatin1String("Message was rejected by the server, error: ") + line); m_state = Close; } break; diff --git a/src/gui/properties/trackersadditiondlg.cpp b/src/gui/properties/trackersadditiondlg.cpp index cf98eea63..5a63f9fd7 100644 --- a/src/gui/properties/trackersadditiondlg.cpp +++ b/src/gui/properties/trackersadditiondlg.cpp @@ -105,7 +105,7 @@ void TrackersAdditionDlg::parseUTorrentList(const QString &, const QString &path m_ui->trackers_list->insertPlainText("\n"); int nb = 0; while (!list_file.atEnd()) { - const QByteArray line = list_file.readLine().trimmed(); + const QString line = list_file.readLine().trimmed(); if (line.isEmpty()) continue; BitTorrent::TrackerEntry newTracker(line); if (!existingTrackers.contains(newTracker)) { diff --git a/src/src.pro b/src/src.pro index c3b2c0ec9..2d2b698f1 100644 --- a/src/src.pro +++ b/src/src.pro @@ -57,8 +57,8 @@ CONFIG(release, debug|release) { include(../version.pri) DEFINES += QT_NO_CAST_TO_ASCII -# Fast concatenation (Qt >= 4.6) -DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS +# Efficient construction for QString & QByteArray (Qt >= 4.8) +DEFINES += QT_USE_QSTRINGBUILDER win32: DEFINES += NOMINMAX