Skip to content

Clear current path when deselecting files #107683

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jun 18, 2025

Fixes #92867

godot.windows.editor.dev.x86_64_ZLnIosw8vX.mp4

This also fixes a problem where you may end up with a random file selected after project restart, which can result in many uncollapsed folders.

@KoBeWi KoBeWi added this to the 4.5 milestone Jun 18, 2025
@KoBeWi KoBeWi requested a review from a team as a code owner June 18, 2025 20:52
Comment on lines +3584 to +3585
current_path = "";
current_path_line_edit->set_text(current_path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it should be associated to its own method that sets both at once, but I don't know about the internals of this

Copy link
Member Author

@KoBeWi KoBeWi Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I counted 2 other places that could use the method. In other cases the path and text are assigned separately, like

current_path = p_file.get_base_dir();
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
while (!da->dir_exists(current_path)) {
current_path = current_path.get_base_dir();
}
current_path_line_edit->set_text(current_path);

so the method would be not very useful.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should've always been the case even if it didn't fix anything

@Repiteo Repiteo merged commit b727436 into godotengine:master Jun 24, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 24, 2025

Thanks!

@KoBeWi KoBeWi deleted the nothing_ever_selects branch June 24, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving a scene re-selects a file
3 participants