After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753321 - Smart bookmarks are added twice to the completion menu
Smart bookmarks are added twice to the completion menu
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-06 14:06 UTC by Carlos Garcia Campos
Modified: 2015-08-10 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-completion-model: Do not add smart bookmarks to the completion model (2.57 KB, patch)
2015-08-06 14:07 UTC, Carlos Garcia Campos
committed Details | Review
ephy-location-entry: Get rid of the cell data func to set the text (8.18 KB, patch)
2015-08-07 09:19 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2015-08-06 14:06:57 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.
Comment 1 Carlos Garcia Campos 2015-08-06 14:07:57 UTC
Created attachment 308852 [details] [review]
ephy-completion-model: Do not add smart bookmarks to the completion model
Comment 2 Carlos Garcia Campos 2015-08-06 14:14:23 UTC
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.
Comment 3 Carlos Garcia Campos 2015-08-07 09:15:40 UTC
(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.
Comment 4 Carlos Garcia Campos 2015-08-07 09:19:47 UTC
Created attachment 308883 [details] [review]
ephy-location-entry: Get rid of the cell data func to set the text
Comment 5 Michael Catanzaro 2015-08-08 20:46:16 UTC
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.
Comment 6 Carlos Garcia Campos 2015-08-10 09:20:19 UTC
Pushed patches to git master