From 26c71943742e44f187a3834839e8a3e3c27f2122 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 7 Oct 2019 18:23:25 +0200 Subject: [PATCH] Sort addons less prominently than applications Otherwise we get a bunch of addons whenever we search for the application in question. See https://bugs.kde.org/show_bug.cgi?id=407588 --- src/as-cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/as-cache.c b/src/as-cache.c index abfdc59c..435aefba 100644 --- a/src/as-cache.c +++ b/src/as-cache.c @@ -2049,6 +2049,10 @@ as_cache_update_results_with_fts_value (AsCache *cache, MDB_txn *txn, MDB_val dv sort_score |= match_pval << 2; else sort_score |= match_pval; + + if (as_component_get_kind(cpt) == AS_COMPONENT_KIND_ADDON) + sort_score--; + as_component_set_sort_score (cpt, sort_score); g_hash_table_insert (results_ht, @@ -2061,6 +2065,10 @@ as_cache_update_results_with_fts_value (AsCache *cache, MDB_txn *txn, MDB_val dv sort_score |= match_pval << 2; else sort_score |= match_pval; + + if (as_component_get_kind(cpt) == AS_COMPONENT_KIND_ADDON) + sort_score--; + as_component_set_sort_score (cpt, sort_score); } }