GNOME Bugzilla – Bug 753321
Smart bookmarks are added twice to the completion menu
Last modified: 2015-08-10 09:20:19 UTC
First EphyLocationController add them as completion actions, and then EphyCompletionModel adds them to the completion model together with the other bookmarks. Also since 17e4d34628fc425c08a5c6d9cc2419bf3926222f (null) is shown as the URL of the smart bookmark, because g_uri_unescape_string() returns NULL for the smart bookmark url.
Created attachment 308852 [details] [review] ephy-completion-model: Do not add smart bookmarks to the completion model
Debugging this I've also noticed that the textcell_data_func function is called repeatedly once you close the completion menu. 1.- Add a printf there 2.- type something in the location entry, the popup is shown. 3.- Do not select any option, just click somewhere to close the menu. 4.- The function is called all the time while the location entry is visible It stops when the title box is in title mode, as soon as it switches to location mode again, the function is called all the time. We need to investigate this.
(In reply to Carlos Garcia Campos from comment #2) > Debugging this I've also noticed that the textcell_data_func function is > called repeatedly once you close the completion menu. > > 1.- Add a printf there > 2.- type something in the location entry, the popup is shown. > 3.- Do not select any option, just click somewhere to close the menu. > 4.- The function is called all the time while the location entry is visible > > It stops when the title box is in title mode, as soon as it switches to > location mode again, the function is called all the time. We need to > investigate this. It seems that changing the model in the cell data func callback confuses GtkTreeView that keeps validating the rows all the time while the popup is hidden. The fact that GtkEntry recomputes the size of the popup on every size_allocate even when the popup is hidden doesn't help either. So, not changing the model inside the cell data func callback prevents the rows from being activated indefinitely, but still the cell data func is called too often in my opinion. And we are always setting the same text for every row, so I think we should set the title in the model and get rid of the cell data func.
Created attachment 308883 [details] [review] ephy-location-entry: Get rid of the cell data func to set the text
Review of attachment 308852 [details] [review]: Both patches LGTM. ::: src/ephy-completion-model.c @@ +433,1 @@ + if (!is_smart && should_add_bookmark_to_model (model, user_data->search_string, Probably would be good to have a comment here to explain why smart bookmarks are excluded.
Pushed patches to git master