From b9094ff8a52687f72e7a70d0e53e696a94efe24a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 30 Jun 2019 20:39:49 +0800 Subject: [PATCH] Use proper log message when there are no error --- src/base/bittorrent/session.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 7bcc23ae8..4da1db24d 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -4042,9 +4042,14 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale // so we remove the directory ourselves Utils::Fs::smartRemoveEmptyFolderTree(tmpRemovingTorrentData.savePathToRemove); - LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...") - .arg(tmpRemovingTorrentData.name, QString::fromLocal8Bit(p->error.message().c_str())) - , Log::CRITICAL); + if (p->error) { + LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...") + .arg(tmpRemovingTorrentData.name, QString::fromStdString(p->error.message())) + , Log::WARNING); + } + else { + LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name)); + } } void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)