Fix FileSystem dock navigation when using Split Mode
Fixes #100277
The regression was introduced by #100010 (most likely), which made bigger changes to _navigate_to_path().
This also simplifies the logic a bit, and does less trimming and appending of / all the time.
Show in FileSystem does not work properly in split mode. You need to use it twice to show the file.
Show in FileSystem does not work properly in split mode. You need to use it twice to show the file.
Fixed.
Also, I've noticed that every time navigate_to_path() is called, _navigate_to_path() will be called twice, because of the "Filter Files" search box being cleared with file_list_search_box->clear() and thus invoking _search_changed().
This would be simple enough to fix in the case when it's already empty and doesn't need to be cleared, but in the other case it's a little more involved. Since this is also kind of a separate issue, it's probably better handled in a separate PR.
_navigate_to_path() will be called twice, because of the "Filter Files" search box being cleared with file_list_search_box->clear() and thus invoking _search_changed().
Sounds like #100275 will fix it.
Another bug is that it changes behavior when navigating to folder depending on / suffix. With the suffix it correctly selects the folder in tree (in split view), without the suffix it selects the parent folder instead.
The previous implementation was a bit hacky, but it was to ensure that folders work correctly both with and without the / suffix.
It should work now regardless of the path ending with / or not. I also made it default to res:// if the given path is empty.
Thanks!
KoBeWi comments were all non-blockers, so they can be handled in a separate PR