GNOME Bugzilla – Bug 726519
Crash when moving from preview to search with a source filter
Last modified: 2014-03-17 13:02:00 UTC
Launch the application and set a source filter. Click an item to preview it, and then try going back to the search results. The application crashes. When going back from the preview to search, we unset the active item (in PhotosMainToolbar), which leads to the parameters of the search being restored (in PhotosEmbed). Then we change the window-mode (in PhotosMainToolbar). Since photos_main_toolbar_set_toolbar_title is listening to changes in the active source, it is executed with window_mode == PREVIEW and active_item == NULL. This leads to the crash. We should guard against such transitional states by checking active_item for NULL. But, why are we listening to changes in the active source in the first place? Looks like gnome-documents listens to changes in all the search parameters so that it can change the title to "Presentations" or "Results for 'search string'". That still does not explain the need for listening to the active source because the SourceManager is not used. Moreover, in the new multi-view designs, we are not supposed to change the title like this.
Created attachment 272139 [details] [review] main-toolbar: Guard against being in a transitional state
Created attachment 272140 [details] [review] main-toolbar: Remove useless signal connections
Created attachment 272141 [details] [review] main-toolbar: Remove empty else branch