|
|
@ -62,6 +62,10 @@ |
|
|
|
#include "transferlistsortmodel.h" |
|
|
|
#include "transferlistsortmodel.h" |
|
|
|
#include "updownratiodlg.h" |
|
|
|
#include "updownratiodlg.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_MAC |
|
|
|
|
|
|
|
#include "macutilities.h" |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
namespace |
|
|
|
{ |
|
|
|
{ |
|
|
|
using ToggleFn = std::function<void (Qt::CheckState)>; |
|
|
|
using ToggleFn = std::function<void (Qt::CheckState)>; |
|
|
@ -358,10 +362,14 @@ void TransferListWidget::torrentDoubleClicked() |
|
|
|
torrent->pause(); |
|
|
|
torrent->pause(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case OPEN_DEST: |
|
|
|
case OPEN_DEST: |
|
|
|
|
|
|
|
#ifdef Q_OS_MAC |
|
|
|
|
|
|
|
MacUtils::openFiles(QSet<QString>{torrent->contentPath(true)}); |
|
|
|
|
|
|
|
#else |
|
|
|
if (torrent->filesCount() == 1) |
|
|
|
if (torrent->filesCount() == 1) |
|
|
|
Utils::Misc::openFolderSelect(torrent->contentPath(true)); |
|
|
|
Utils::Misc::openFolderSelect(torrent->contentPath(true)); |
|
|
|
else |
|
|
|
else |
|
|
|
Utils::Misc::openPath(torrent->contentPath(true)); |
|
|
|
Utils::Misc::openPath(torrent->contentPath(true)); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -548,6 +556,15 @@ void TransferListWidget::hidePriorityColumn(bool hide) |
|
|
|
void TransferListWidget::openSelectedTorrentsFolder() const |
|
|
|
void TransferListWidget::openSelectedTorrentsFolder() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
QSet<QString> pathsList; |
|
|
|
QSet<QString> pathsList; |
|
|
|
|
|
|
|
#ifdef Q_OS_MAC |
|
|
|
|
|
|
|
// On macOS you expect both the files and folders to be opened in their parent
|
|
|
|
|
|
|
|
// folders prehilighted for opening, so we use a custom method.
|
|
|
|
|
|
|
|
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents()) { |
|
|
|
|
|
|
|
QString path = torrent->contentPath(true); |
|
|
|
|
|
|
|
pathsList.insert(path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MacUtils::openFiles(pathsList); |
|
|
|
|
|
|
|
#else |
|
|
|
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents()) { |
|
|
|
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents()) { |
|
|
|
QString path = torrent->contentPath(true); |
|
|
|
QString path = torrent->contentPath(true); |
|
|
|
if (!pathsList.contains(path)) { |
|
|
|
if (!pathsList.contains(path)) { |
|
|
@ -558,6 +575,7 @@ void TransferListWidget::openSelectedTorrentsFolder() const |
|
|
|
} |
|
|
|
} |
|
|
|
pathsList.insert(path); |
|
|
|
pathsList.insert(path); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TransferListWidget::previewSelectedTorrents() |
|
|
|
void TransferListWidget::previewSelectedTorrents() |
|
|
|