mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Merge pull request #3984 from glassez/root_path
Fix TorrentHandle path methods. Closes #3847.
This commit is contained in:
commit
472fff06dc
9 changed files with 90 additions and 54 deletions
|
@ -827,11 +827,7 @@ bool Session::deleteTorrent(const QString &hash, bool deleteLocalFiles)
|
|||
|
||||
// Remove it from session
|
||||
if (deleteLocalFiles) {
|
||||
QString tmp = torrent->filePath(0);
|
||||
tmp.truncate(tmp.indexOf("/")); // get the torrent root directory name
|
||||
if (!tmp.isEmpty())
|
||||
m_savePathsToRemove[torrent->hash()] = torrent->actualSavePath() + tmp;
|
||||
|
||||
m_savePathsToRemove[torrent->hash()] = torrent->rootPath(true);
|
||||
m_nativeSession->remove_torrent(torrent->nativeHandle(), libt::session::delete_files);
|
||||
}
|
||||
else {
|
||||
|
@ -1736,7 +1732,7 @@ void Session::handleTorrentFinished(TorrentHandle *const torrent)
|
|||
const QString torrentRelpath = torrent->filePath(i);
|
||||
if (torrentRelpath.endsWith(".torrent", Qt::CaseInsensitive)) {
|
||||
qDebug("Found possible recursive torrent download.");
|
||||
const QString torrentFullpath = torrent->actualSavePath() + "/" + torrentRelpath;
|
||||
const QString torrentFullpath = torrent->savePath(true) + "/" + torrentRelpath;
|
||||
qDebug("Full subtorrent path is %s", qPrintable(torrentFullpath));
|
||||
TorrentInfo torrentInfo = TorrentInfo::loadFromFile(torrentFullpath);
|
||||
if (torrentInfo.isValid()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue