Going back to search causes mixed results
Affected version
- Nightly flatpak
- Other: 43
Steps to reproduce
- Open a folder from the sidebar
- Search for something in that folder
- Open another folder from the sidebar
- Go back
Current behavior
The previous search results are shown (with a different path caption from before). Additionally, new results from the second folder are added, if any are found.
Expected behavior
The previous search results are shown exactly are they were at set 3.
Additional information
While debugging this I found that, when going back, we restore the query from the saved NautilusSearchDirectory.
However, that query is the same that was saved in the NautilusQueryEditor. So, at step 3, when the NautilusWindowSlot:location changes, it causes NautiusQueryEditor:location to change too (through a binding), which in turn changed the location of the saved query (as part of nautilus_query_editor_set_location()
).
One possible solution is to, when going back to a NautilusSearchDirectory, take its base location and set the query's location to it. Feel like a dirty workaround, though.
Another possible solution is to change nautilus_query_editor_set_location()
to create a new query with the new location, instead of setting the new location on the saved query.
I hit a few crashes with these solutions, and I don't have much more time, so leaving this braindump here for future reference.