mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
Allow add torrents with relative save path
The relative save path will be resoloved against the default one.
This commit is contained in:
parent
a51742b47c
commit
89cedd411e
@ -2062,8 +2062,10 @@ LoadTorrentParams Session::initLoadTorrentParams(const AddTorrentParams &addTorr
|
|||||||
const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!isAutoTMMDisabledByDefault());
|
const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!isAutoTMMDisabledByDefault());
|
||||||
if (useAutoTMM)
|
if (useAutoTMM)
|
||||||
loadTorrentParams.savePath = "";
|
loadTorrentParams.savePath = "";
|
||||||
else if (addTorrentParams.savePath.trimmed().isEmpty())
|
else if (addTorrentParams.savePath.isEmpty())
|
||||||
loadTorrentParams.savePath = defaultSavePath();
|
loadTorrentParams.savePath = defaultSavePath();
|
||||||
|
else if (QDir(addTorrentParams.savePath).isRelative())
|
||||||
|
loadTorrentParams.savePath = QDir(defaultSavePath()).absoluteFilePath(addTorrentParams.savePath);
|
||||||
else
|
else
|
||||||
loadTorrentParams.savePath = normalizePath(addTorrentParams.savePath);
|
loadTorrentParams.savePath = normalizePath(addTorrentParams.savePath);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user