mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
Fix torrent file selection in Finder on mac
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "macutilities.h"
|
||||
|
||||
#include <QSet>
|
||||
#include <QtMac>
|
||||
#include <objc/message.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
@@ -81,3 +82,15 @@ void displayNotification(const QString &title, const QString &message)
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
|
||||
}
|
||||
}
|
||||
|
||||
void openFiles(const QSet<QString> &pathsList)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSMutableArray *pathURLs = [NSMutableArray arrayWithCapacity:pathsList.size()];
|
||||
|
||||
for (const auto &path : pathsList)
|
||||
[pathURLs addObject:[NSURL fileURLWithPath:path.toNSString()]];
|
||||
|
||||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:pathURLs];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user