1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Log file rename failed errors

This commit is contained in:
Chocobo1 2019-06-04 18:49:51 +08:00
parent eabcae1018
commit 8191f1498a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -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()();