Skip to content

window-slot: Avoid inconsistent saved navigation

Navigation state includes both a reference to the NautilusFile instance for the current location and a reference to the current navigation bookmark, since 9c08b6d2

Back then, the location pointed by both the NautilusFile instance and the NautilusBookmark instance would be always the same. But this assumption no longer holds up when the view is searching, because the NautilusFile instance for the current location points to the search results directory, which is not added as a bookmark in the history stack anymore since d06b4d6a

As a result, after restoring a tab which had been closed while showing search results, the reconstructed navigation history is inconsistent.

Let's use a single source of truth for the location to restore, the bookmark, and stop saving and restoring the either redundact or conflicting NautilusFile instance.

As a side effect of this change, restoring tabs closed while searching simply restores the location where the search was triggered from, not restoring the search query itself. That's a temporary regression to be fixed in the second commit.

Merge request reports