From 1d4071d6d8dff250482e90079a175f6f854ed996 Mon Sep 17 00:00:00 2001 From: Prince Gupta <34717789+jagannatharjun@users.noreply.github.com> Date: Sun, 30 Jan 2022 11:24:37 +0530 Subject: [PATCH] Don't rename file because of difference in path separator PR #16317. --- src/base/bittorrent/torrentimpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 6f689401a..19e1f9638 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -2039,10 +2039,16 @@ void TorrentImpl::manageIncompleteFiles() return; } + const lt::file_storage &nativeFiles = m_nativeHandle.torrent_file()->files(); + for (int i = 0; i < filesCount(); ++i) { const QString path = filePath(i); - const QString actualPath = actualFilePath(i); + + const auto nativeIndex = m_torrentInfo.nativeIndexes().at(i); + const QString actualPath = Utils::Fs::toUniformPath( + QString::fromStdString(nativeFiles.file_path(nativeIndex))); + if (isAppendExtensionEnabled && (fileSize(i) > 0) && (fp[i] < 1)) { const QString wantedPath = path + QB_EXT;