GNOME Bugzilla – Bug 734597
PlaceEntry completion: name doesn't show.
Last modified: 2014-08-24 18:07:18 UTC
When using the entrycompletion in a PlaceEntry to choose a location the name of the choosen place should be shown in the entry. It currently isn't (it works fine selecting results from the popover though). From a little debugging it seems that PlaceEntry.text is properly set to place.name when a new place is set but then immediately gets cleared.
The 'match-selected' signal correctly sets the place but then the 'search-signal' activates and sets the place to null, as the length of search text becomes 0 on selecting a place from the EntryCompletion list. Why does search text becomes empty on selecting a place from the entry completion list?? Maybe a GTKEntryCompletion bug. This doesn't happen on selecting the place from SearchPopup.
Created attachment 284355 [details] [review] placeEntry: Return true from 'match-selected' The documentation for GtkEntryCompletion states: "When the user selects a completion, the content of the entry is updated. By default, the content of the entry is replaced by the text column of the model, but this can be overridden by connecting to the "match-selected" signal and updating the entry in the signal handler. Note that you should return TRUE from the signal handler to suppress the default behaviour." We update the entry in our signal handler but we do not return TRUE. This results in the text being set to the empty string and setting the place of the placeEntry to null.
Attachment 284355 [details] pushed as d64ce65 - placeEntry: Return true from 'match-selected'