mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
Fix torrent file selection in Finder on mac
This commit is contained in:
parent
84c84160fd
commit
d57bd62add
3 changed files with 28 additions and 0 deletions
|
@ -62,6 +62,10 @@
|
|||
#include "transferlistsortmodel.h"
|
||||
#include "updownratiodlg.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "macutilities.h"
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
using ToggleFn = std::function<void (Qt::CheckState)>;
|
||||
|
@ -548,6 +552,15 @@ void TransferListWidget::hidePriorityColumn(bool hide)
|
|||
void TransferListWidget::openSelectedTorrentsFolder() const
|
||||
{
|
||||
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);
|
||||
}
|
||||
openFiles(pathsList);
|
||||
#else
|
||||
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents()) {
|
||||
QString path = torrent->contentPath(true);
|
||||
if (!pathsList.contains(path)) {
|
||||
|
@ -558,6 +571,7 @@ void TransferListWidget::openSelectedTorrentsFolder() const
|
|||
}
|
||||
pathsList.insert(path);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void TransferListWidget::previewSelectedTorrents()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue