-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "Open destination folder" on macOS #17305
Conversation
it already provides absolute path, no additional manipulations are required.
Thank you for the fix! macOS related code, apparently, has not been changed/fixed due to the fact that it remains behind the scenes when developing on other platforms. |
In some unknown way, the one line in Objective-C affects Qt's main loop causing the crash in QApplication::exec() on processing next event after that 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 that code in another thread solves the issue.
@@ -106,7 +106,15 @@ void openFiles(const PathList &pathList) | |||
for (const auto &path : pathList) | |||
[pathURLs addObject:[NSURL fileURLWithPath:path.toString().toNSString()]]; | |||
|
|||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:pathURLs]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a Qt related issue maybe try to solve it without touching macOS related code (which is still correct)? I mean something like invoking openFiles using queued invocation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially I did. but openFiles() is used in multiple places, so decided to add workaround exactly inside that function
@Kolcha Also this should be back port to v4.4.x |
In some unknown way, the one line in Objective-C affects Qt's main loop causing the crash in QApplication::exec() on processing next event after that 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 that code in another thread solves the issue. Original PR: qbittorrent#17305.
In some unknown way, the one line in Objective-C affects Qt's main loop causing the crash in QApplication::exec() on processing next event after that 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 that code in another thread solves the issue. Original PR: #17305.
actually 2 issues where fixed (see commit messages for details):
Torrent::contentPath()
already returns correct abolute path to the torrent content, it considers any possible situationsexisting code tried to append some "prefix" and that lead to not existing "slightly duplicated" path like
so destination folder was not opened in any case (but no crash happens in such case)
crash was not actually fixed, its source somewhere deep in Qt, just some workaround added, see corresponding comment in the code.
build was tested on both MacBooks: Intel-based (Core i9, 2019) and M1-based (M1 Pro, 2021)
Fixes #17273