From 8191f1498a56e2da92eb2055c487cfeed65a29dc Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 4 Jun 2019 18:49:51 +0800 Subject: [PATCH] Log file rename failed errors --- src/base/bittorrent/torrenthandle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index d807212ea..41a1a0a05 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1479,10 +1479,9 @@ void TorrentHandle::moveStorage(const QString &newPath, bool overwrite) } } -void TorrentHandle::renameFile(int index, const QString &name) +void TorrentHandle::renameFile(const int index, const QString &name) { ++m_renameCount; - qDebug() << Q_FUNC_INFO << index << name; m_nativeHandle.rename_file(index, Utils::Fs::toNativePath(name).toStdString()); } @@ -1777,6 +1776,10 @@ void TorrentHandle::handleFileRenameFailedAlert(const lt::file_rename_failed_ale { Q_UNUSED(p); + LogMsg(tr("File rename failed. Torrent: \"%1\", file: \"%2\", reason: \"%3\"") + .arg(name(), filePath(p->index) + , QString::fromStdString(p->error.message())), Log::WARNING); + --m_renameCount; while (!isMoveInProgress() && (m_renameCount == 0) && !m_moveFinishedTriggers.isEmpty()) m_moveFinishedTriggers.takeFirst()();