Redesign "Incomplete folder" feature

Change "Incomplete/temp folder" term with "download folder".
Allow to set "download folder" per torrent (in manual mode) and per category (in automatic mode).
This commit is contained in:
Vladimir Golovnev (Glassez) 2021-05-20 10:36:44 +03:00 committed by Vladimir Golovnev (glassez)
parent b0e41abf5a
commit 1c0f8b4289
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
48 changed files with 1457 additions and 599 deletions

View file

@ -34,7 +34,7 @@
#include "base/bittorrent/infohash.h"
void FileSearcher::search(const BitTorrent::TorrentID &id, const QStringList &originalFileNames
, const QString &completeSavePath, const QString &incompleteSavePath)
, const QString &savePath, const QString &downloadPath)
{
const auto findInDir = [](const QString &dirPath, QStringList &fileNames) -> bool
{
@ -56,14 +56,14 @@ void FileSearcher::search(const BitTorrent::TorrentID &id, const QStringList &or
return found;
};
QString savePath = completeSavePath;
QString usedPath = savePath;
QStringList adjustedFileNames = originalFileNames;
const bool found = findInDir(savePath, adjustedFileNames);
if (!found && !incompleteSavePath.isEmpty())
const bool found = findInDir(usedPath, adjustedFileNames);
if (!found && !downloadPath.isEmpty())
{
savePath = incompleteSavePath;
findInDir(savePath, adjustedFileNames);
usedPath = downloadPath;
findInDir(usedPath, adjustedFileNames);
}
emit searchFinished(id, savePath, adjustedFileNames);
emit searchFinished(id, usedPath, adjustedFileNames);
}