From 0d6deca15c0cec17da6d3fd1608352c322d8ef63 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 5 May 2018 21:21:33 +0800 Subject: [PATCH] Revert commit Apparently the translations were working in previous state, but affected by lupdate issue: https://github.com/qbittorrent/qBittorrent/issues/8220#issuecomment-385712673 The reverts commit fb698896c9cd69f3c1c48c078cd43555a2033d5e. Closes #8831. --- src/base/bittorrent/torrenthandle.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 4f49f5c88..84413be48 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -156,8 +156,6 @@ const int TorrentHandle::MAX_SEEDING_TIME = 525600; // The following can be removed after one or two libtorrent releases on each branch. namespace { - const char i18nContext[] = "TorrentHandle"; - // new constructor is available template::value, int>::type = 0> T makeTorrentCreator(const libtorrent::torrent_info & ti) @@ -1476,8 +1474,8 @@ void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_fail return; } - LogMsg(QCoreApplication::translate(i18nContext, "Could not move torrent: '%1'. Reason: %2") - .arg(name(), QString::fromStdString(p->message())), Log::CRITICAL); + LogMsg(tr("Could not move torrent: '%1'. Reason: %2") + .arg(name(), QString::fromStdString(p->message())), Log::CRITICAL); m_moveStorageInfo.newPath.clear(); if (!m_moveStorageInfo.queuedPath.isEmpty()) { @@ -1649,19 +1647,18 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data void TorrentHandle::handleFastResumeRejectedAlert(libtorrent::fastresume_rejected_alert *p) { qDebug("/!\\ Fast resume failed for %s, reason: %s", qUtf8Printable(name()), p->message().c_str()); - Logger *const logger = Logger::instance(); updateStatus(); if (p->error.value() == libt::errors::mismatching_file_size) { // Mismatching file size (files were probably moved) - logger->addMessage(QCoreApplication::translate(i18nContext, "File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL); + LogMsg(tr("File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL); m_hasMissingFiles = true; if (!isPaused()) pause(); } else { - logger->addMessage(QCoreApplication::translate(i18nContext, "Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...") - .arg(name(), QString::fromStdString(p->message())), Log::CRITICAL); + LogMsg(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...") + .arg(name(), QString::fromStdString(p->message())), Log::CRITICAL); } }