mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Fix renaming completed files
Check whether the file is already downloaded before appending QB_EXT to filename. Closes #8039.
This commit is contained in:
parent
1055cc0f45
commit
898239a42e
1 changed files with 4 additions and 1 deletions
|
@ -712,7 +712,10 @@ void PropertiesWidget::renameSelectedFile()
|
|||
newName.chop(QB_EXT.size());
|
||||
const QString oldFileName = m_torrent->fileName(fileIndex);
|
||||
const QString oldFilePath = m_torrent->filePath(fileIndex);
|
||||
const QString newFileName = newName + (BitTorrent::Session::instance()->isAppendExtensionEnabled() ? QB_EXT : QString());
|
||||
|
||||
const bool useFilenameExt = BitTorrent::Session::instance()->isAppendExtensionEnabled()
|
||||
&& (m_torrent->filesProgress()[fileIndex] != 1);
|
||||
const QString newFileName = newName + (useFilenameExt ? QB_EXT : QString());
|
||||
const QString newFilePath = oldFilePath.leftRef(oldFilePath.size() - oldFileName.size()) + newFileName;
|
||||
|
||||
if (oldFileName == newFileName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue