From 5ebbed8160083ce8fb22bdd400ecfb259f365960 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 13 Jan 2022 16:24:17 +0800 Subject: [PATCH 1/3] Revise error message Remove the period mark at the end of error message since `errc.message()` already contains one. --- src/base/bittorrent/torrentimpl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index e97ce2e76..b86a511a3 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -1028,10 +1028,9 @@ QString TorrentImpl::error() const if (m_nativeStatus.flags & lt::torrent_flags::upload_mode) { const QString writeErrorStr = tr("Couldn't write to file."); - const QString uploadModeStr = tr("Torrent is currently in \"upload only\" mode."); - const QString errorMessage = QString::fromLocal8Bit(m_lastFileError.error.message().c_str()); - - return writeErrorStr + QLatin1Char(' ') + errorMessage + QLatin1String(". ") + uploadModeStr; + const QString uploadModeStr = tr("Torrent is now in \"upload only\" mode."); + const QString errorMessage = tr("Reason:") + QLatin1Char(' ') + QString::fromLocal8Bit(m_lastFileError.error.message().c_str()); + return QString::fromLatin1("%1 %2 %3").arg(writeErrorStr, errorMessage, uploadModeStr); } return {}; From dca69f053aa4a507ef72b2478878b1d9ce630279 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 13 Jan 2022 16:30:43 +0800 Subject: [PATCH 2/3] Remove outdated build configuration --- conf.pri.windows | 2 -- configure | 19 ------------------- configure.ac | 3 --- 3 files changed, 24 deletions(-) diff --git a/conf.pri.windows b/conf.pri.windows index 88cd406c3..8b665695c 100644 --- a/conf.pri.windows +++ b/conf.pri.windows @@ -37,8 +37,6 @@ DEFINES += BOOST_ALL_NO_LIB # Use one of the following options DEFINES += BOOST_SYSTEM_STATIC_LINK #DEFINES += BOOST_SYSTEM_DYN_LINK -# Enable if encountered build error with boost version <= 1.59 -#DEFINES += BOOST_NO_CXX11_RVALUE_REFERENCES # Enable if libtorrent was built with this flag defined #DEFINES += TORRENT_NO_DEPRECATE diff --git a/configure b/configure index 237fe6ed9..e4f3090d0 100755 --- a/configure +++ b/configure @@ -6020,25 +6020,6 @@ LDFLAGS="$BOOST_LDFLAGS $LDFLAGS" # taken from ax_boost_base.m4 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < (106000))])); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - QBT_ADD_DEFINES="$QBT_ADD_DEFINES BOOST_NO_CXX11_RVALUE_REFERENCES" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent-rasterbar >= 2.0.4" >&5 diff --git a/configure.ac b/configure.ac index 0067aa9db..ea5ef2832 100644 --- a/configure.ac +++ b/configure.ac @@ -187,9 +187,6 @@ m4_define([DETECT_BOOST_VERSION_PROGRAM], [AC_LANG_PROGRAM([[#include ]], [[(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));]])]) -AC_COMPILE_IFELSE([DETECT_BOOST_VERSION_PROGRAM(106000)], [], - [QBT_ADD_DEFINES="$QBT_ADD_DEFINES BOOST_NO_CXX11_RVALUE_REFERENCES"]) - PKG_CHECK_MODULES(libtorrent, [libtorrent-rasterbar >= 2.0.4], [CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS" LIBS="$libtorrent_LIBS $LIBS" QBT_ADD_DEFINES="$QBT_ADD_DEFINES QBT_USES_LIBTORRENT2"], From d6dce1efe91ee0262c601f9e4f9abb9f14ddf104 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 13 Jan 2022 16:33:59 +0800 Subject: [PATCH 3/3] Add comment for new libtorrent build flag Upstream change: https://github.com/arvidn/libtorrent/commit/66def8908909232b15f02a97c9671785bd019736 --- conf.pri.windows | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf.pri.windows b/conf.pri.windows index 8b665695c..0b845b618 100644 --- a/conf.pri.windows +++ b/conf.pri.windows @@ -37,6 +37,8 @@ DEFINES += BOOST_ALL_NO_LIB # Use one of the following options DEFINES += BOOST_SYSTEM_STATIC_LINK #DEFINES += BOOST_SYSTEM_DYN_LINK +# Enable it if compiling with libtorrent 3.x +#DEFINES += BOOST_SYSTEM_USE_UTF8 # Enable if libtorrent was built with this flag defined #DEFINES += TORRENT_NO_DEPRECATE