mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 01:57:07 -07:00
Fix "Open destination folder" functionality to consider torrent root folder
This commit is contained in:
parent
ee96f83211
commit
02c4be4eaa
2 changed files with 18 additions and 6 deletions
|
@ -402,16 +402,16 @@ void TransferListWidget::hidePriorityColumn(bool hide) {
|
|||
}
|
||||
|
||||
void TransferListWidget::openSelectedTorrentsFolder() const {
|
||||
QStringList pathsList;
|
||||
QSet<QString> pathsList;
|
||||
const QStringList hashes = getSelectedTorrentsHashes();
|
||||
foreach (const QString &hash, hashes) {
|
||||
const QTorrentHandle h = BTSession->getTorrentHandle(hash);
|
||||
if (h.is_valid()) {
|
||||
const QString savePath = h.save_path();
|
||||
qDebug("Opening path at %s", qPrintable(savePath));
|
||||
if (!pathsList.contains(savePath)) {
|
||||
pathsList.append(savePath);
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(savePath));
|
||||
QString rootFolder = h.root_path();
|
||||
qDebug("Opening path at %s", qPrintable(rootFolder));
|
||||
if (!pathsList.contains(rootFolder)) {
|
||||
pathsList.insert(rootFolder);
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(rootFolder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue