Skip to content

Commit

Permalink
app: Check for component name when searching
Browse files Browse the repository at this point in the history
We add the component name as part of the fallback search.

Before this patch, queries as

    flatpak search Element

or

    flatpak search d-spy

return no results even though the search term coincides with the
application name.
  • Loading branch information
A6GibKm authored and TingPing committed Oct 17, 2024
1 parent bb5c419 commit dc2ce2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/flatpak-builtins-search.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ flatpak_builtin_search (int argc, char **argv, GCancellable *cancellable, GError
if (score == 0)
{
g_autofree char *app_id = component_get_flatpak_id (app);
if (strcasestr (app_id, search_text) != NULL)
const char *app_name = as_component_get_name (app);
if (strcasestr (app_id, search_text) != NULL || strcasestr (app_name, search_text) != NULL)
score = 50;
else
continue;
Expand Down

0 comments on commit dc2ce2c

Please sign in to comment.