mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
Fix TorrentHandle rootPath() and contentPath() methods
This commit is contained in:
@@ -312,6 +312,9 @@ QString TorrentHandle::savePath(bool actual) const
|
||||
|
||||
QString TorrentHandle::rootPath(bool actual) const
|
||||
{
|
||||
if ((filesCount() > 1) && !hasRootFolder())
|
||||
return QString();
|
||||
|
||||
QString firstFilePath = filePath(0);
|
||||
const int slashIndex = firstFilePath.indexOf("/");
|
||||
if (slashIndex >= 0)
|
||||
@@ -324,8 +327,10 @@ QString TorrentHandle::contentPath(bool actual) const
|
||||
{
|
||||
if (filesCount() == 1)
|
||||
return QDir(savePath(actual)).absoluteFilePath(filePath(0));
|
||||
else
|
||||
else if (hasRootFolder())
|
||||
return rootPath(actual);
|
||||
else
|
||||
return savePath(actual);
|
||||
}
|
||||
|
||||
bool TorrentHandle::isAutoTMMEnabled() const
|
||||
|
||||
Reference in New Issue
Block a user