Repository navigation
fix(platform): a folder dialog opens on a folder that exists (#331) - #374
Merged
Merged
Conversation
A new project's default location, <Desktop>/Concat, is not made until the first project is, and pick_folder handed it to the dialog as is. GNOME's chooser (Nautilus, behind the portal) answers a folder that is not there with "Unable to find ..." and the window waits on it until GNOME calls it unresponsive. The dialog now starts at the nearest folder of that path that exists: the desktop itself, on a first run. Export and Open, which call pick_folder the same way, get the same. Signed-off-by: chiarorosa <pablo.chiaro.rosa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #331. On a first run the new-project sheet's default location,
<Desktop>/Concat, does not exist yet (default_location()only makes it on iOS), andplatform::pick_folderpassed it torfd::FileDialog::set_directoryas is. The dialog in the report is GNOME's chooser (Nautilus, behind the xdg portal): its "无法找到 "…/Desktop/Concat"" is Nautilus's Unable to find "%s". Please check the spelling and try again., a string onlynautilus.mocarries, and the window then waits on that dialog until GNOME calls it unresponsive.pick_foldernow starts the dialog at the nearest folder of the path that exists, the desktop itself on a first run, and asks for no starting folder when none does (an emptystart, as before). Export and Open callpick_folderthe same way and get the same.How to test
cargo test -p concat a_folder_dialog_starts_at_a_folder_that_exists. By hand, on GNOME 47+ with no~/Desktop/Concat: New project › Location › Select opens on the desktop instead of an error.What I ran, being on Windows without the native dependencies the whole workspace needs:
rustfmt --check(1.93.1, the repo'srustfmt.toml) onplatform.rs.cargo clippy --all-targets -- -D warningsis clean; it also fails under two mutations (onlystartitself checked,is_dirnegated).pick_folderand GTK 4's chooser both open quietly elsewhere on a missing folder, so it's Nautilus specifically that errors; I could not run Nautilus's portal there, so the dialog in the report itself is not reproduced.I have not built the
concatcrate itself, so this relies on CI for the workspaceclippyandtest.Checklist
cargo fmt --checkpasses (rustfmt on the changed file)cargo clippy --all-targets -- -D warningspasses (on the change in isolation; workspace left to CI)cargo testpasses (the new test in isolation; workspace left to CI)python3 scripts/locales.pyrun (if UI text changed): no UI text changed