mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Merge pull request #17305 from Kolcha/fix/open-dest-dir
Fix "Open destination folder" on macOS
This commit is contained in:
commit
ec1d2cba40
2 changed files with 10 additions and 2 deletions
|
@ -106,7 +106,15 @@ namespace MacUtils
|
||||||
for (const auto &path : pathList)
|
for (const auto &path : pathList)
|
||||||
[pathURLs addObject:[NSURL fileURLWithPath:path.toString().toNSString()]];
|
[pathURLs addObject:[NSURL fileURLWithPath:path.toString().toNSString()]];
|
||||||
|
|
||||||
|
// In some unknown way, the next line affects Qt's main loop causing the crash
|
||||||
|
// in QApplication::exec() on processing next event after this call.
|
||||||
|
// Even crash doesn't happen exactly after this call, it will happen on
|
||||||
|
// application exit. Call stack and disassembly are the same in all cases.
|
||||||
|
// But running it in another thread (aka in background) solves the issue.
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
|
||||||
|
{
|
||||||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:pathURLs];
|
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:pathURLs];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -552,7 +552,7 @@ void TransferListWidget::openSelectedTorrentsFolder() const
|
||||||
// folders prehilighted for opening, so we use a custom method.
|
// folders prehilighted for opening, so we use a custom method.
|
||||||
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
|
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
|
||||||
{
|
{
|
||||||
const Path contentPath = torrent->actualStorageLocation() / torrent->contentPath();
|
const Path contentPath = torrent->contentPath();
|
||||||
paths.insert(contentPath);
|
paths.insert(contentPath);
|
||||||
}
|
}
|
||||||
MacUtils::openFiles(PathList(paths.cbegin(), paths.cend()));
|
MacUtils::openFiles(PathList(paths.cbegin(), paths.cend()));
|
||||||
|
|
Loading…
Reference in a new issue