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 734878 - add API to find locations that match search terms
add API to find locations that match search terms
Status: RESOLVED OBSOLETE
Product: libgweather
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: future
Assigned To: libgweather-maint
libgweather-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-15 17:59 UTC by Paolo Borelli
Modified: 2021-06-09 21:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paolo Borelli 2014-08-15 17:59:31 UTC
Both Weather and Clocks have to manually implement a function that takes a bunch of terms and matches them against the location name, country name, etc in order to implement their SearchProviders.

The code is not only duplicated, but also incomplete, since from the application it is only possible to match against the translated names, while LocationEntry also matches again english names.

Such function is also needed if one wants to implement searching without using search entry, e.g. to have a GtkSearchBar and a GtkListView that shows the matches


The API needs a bit of thinking, I see the following possibilities:

1) a plain location_matches(char **terms) and document that the terms should be normalized and casefolded before beeing passed in (I do not want to normalize and casefold the terms for every location)

2) a pair of functions: location_create_serch(terms) that returns an opaque "search" struct and then a location_matches(search). This would hide the normalization and casefolding giving us more freedom of changing the implementation

3) go all the way and create a LocationMatcher object with add(terms) and find and find_async methods in GIO style. This would be nice since it could probably factor out a good part of the Weather and Clocks search providers
Comment 1 GNOME Infrastructure Team 2021-06-09 21:06:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgweather/-/issues/128.