-
-
Notifications
You must be signed in to change notification settings - Fork 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
FileBrowser: "Open containing folder" automatically selects file in the OS's file manager #7700
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sticking to saying "Open containing folder" regardless of OS and opening it using the native file manager (if any) is probably the way to go IMO. It's a lot simpler that way at the cost of little. Also, I'm confused on what this has to do with highlighting files in the Additionally, I think we should be using something like |
Unless you have other concerns, the only downside is maintainability but that should've been fixed in the latest commit.
You're right, this PR is badly titled.
I really do dislike using openUrl. It was really slow for me (like ~5 second wait time) when I was on linux, But almost instant with my PR. |
@sakertooth Many applications have shims that do as the OP is suggesting. I've noticed that this trend has become an unofficial standard over the years for polished software. For example, my IDEs tend to do this same thing and when reading the source code, the techniques are often identical to the OP's. The larger the folder contents, the more useful this feature can become as the file manager will navigate directly to the file that was requested. This is a very well received feature IMO. |
I haven't benchmarked openUrl, but I wholeheartedly agree. A pragmatic solution would leverage the underlying C++ APIs, but Linux lacks a consistently shared framework to leverage something like this and Windows + macOS have the support build into the CLI of their file managers, so this really is the simplest approach for 99% of users. For those 1% of users (e.g. Haiku) we'll need to simply fallback to Qt's inferior handling. |
@sakertooth @AW1534 how much sense would it be to subclass The code also reads more portable anyway since it uses non-LMMS precompiler definitions and focuses on standard ones (e.g. |
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.
Unless you have other concerns, the only downside is maintainability but that should've been fixed in the latest commit.
Just took another peek at the code and it's a lot better. In particular, we aren't making so many references to platform-specific applications like Thunar, Nautilus, Dolphin, etc. The use of xdg-mime
and xdg-open
is a nice solution.
Code-wise, I think we can apply some formatting to the new changes, and I think some simplifications can be made. I can help out a bit if you will allow it.
It seems like we merely fallback to using |
This is a great idea which i'm willing to do, but as @sakertooth said, it probably doesnt need to extend from |
Co-authored-by: Tres Finocchiaro <[email protected]>
absolutely, I'll apply any suggestions you give me |
Agreed. We should probably stash the #pseudocode
"open", "-R"
"explorer", "/select"
"nemo", ""
"other", "--select" |
Tested new installers in Nautilus, Nemo and Finder, all pass. |
Same with Explorer. I'd now say this is ready for merge |
Co-authored-by: Dalton Messmer <[email protected]>
Co-authored-by: Dalton Messmer <[email protected]>
Introduces a new helper class FileRevealer to manage file selection across different platforms (Windows, macOS, Linux, and other *nix operating systems with
xdg
). Includes methods to open and select files or directories using the default file manager on the respective platform.User-Facing Changes:
Other Changes:
FileRevealer::canSelect
method to check if file selection is possible.FileRevealer::select
method to select files or directories using platform-specific commands.