Browse Source

Allow add torrents with relative save path

The relative save path will be resoloved against the default one.
adaptive-webui-19844
Vladimir Golovnev (Glassez) 4 years ago
parent
commit
89cedd411e
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 4
      src/base/bittorrent/session.cpp

4
src/base/bittorrent/session.cpp

@ -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…
Cancel
Save