From 5ebbed8160083ce8fb22bdd400ecfb259f365960 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 13 Jan 2022 16:24:17 +0800 Subject: [PATCH] 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 {};