[Android editor] Fix issue with importing projects #95086
Merged
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.
The issue was introduced by #94113:
Prior to Make
fdialog_project
up to become the child ofProjectManager
instead of child ofProjectDialog
#94113show_dialog()
was invoked inask_for_path_and_show()
before_browse_project_path()
and this had the side effect of updating the value ofproject_path
to the default project path.fdialog_project
's current directory is then set in_browse_project_path()
to the current value ofproject_path
After Make
fdialog_project
up to become the child ofProjectManager
instead of child ofProjectDialog
#94113project_path
has anull
value when used in_browse_project_path()
to updatefdialog_project
's current directory, causing the current directory to default to the filesystem root.The tentative fix checks whether
project_path
is empty, and if so uses to the default project path instead, matching the previous behavior. There are other options available (e.g: initializingproject_path
's value in the constructor instead) so feedback are welcome.We could also revert the other PR, but it may be preferable to fix forward instead since reverting would reintroduce the issue it was addressing.
Fixes #94570