[gnome-software/1940-plugin-priority-no-longer-used-when-deduplicating-applications] gs-app: Use real app/plugin priority in gs_app_compare_priority()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1940-plugin-priority-no-longer-used-when-deduplicating-applications] gs-app: Use real app/plugin priority in gs_app_compare_priority()
- Date: Fri, 14 Oct 2022 07:20:57 +0000 (UTC)
commit 39be84f7e4c903f6973115f809e3a288731e2d11
Author: Milan Crha <mcrha redhat com>
Date: Fri Oct 14 09:18:28 2022 +0200
gs-app: Use real app/plugin priority in gs_app_compare_priority()
As Owen found out and reported in #1940, change in
https://gitlab.gnome.org/GNOME/gnome-software/-/commit/e11a60b4a2ddadacbfbb1a8325b1e8daee574138
did not consider the fact that gs_app_compare_priority() bypasses
the gs_app_get_priority(), thus the plugin priority was not
considered anymore.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1940
lib/gs-app.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index d4b3f912a..51215c7e0 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -400,14 +400,17 @@ gs_app_compare_priority (GsApp *app1, GsApp *app2)
{
GsAppPrivate *priv1 = gs_app_get_instance_private (app1);
GsAppPrivate *priv2 = gs_app_get_instance_private (app2);
+ guint prio1, prio2;
g_return_val_if_fail (GS_IS_APP (app1), 0);
g_return_val_if_fail (GS_IS_APP (app2), 0);
/* prefer prio */
- if (priv1->priority > priv2->priority)
+ prio1 = gs_app_get_priority (app1);
+ prio2 = gs_app_get_priority (app2);
+ if (prio1 > prio2)
return -1;
- if (priv1->priority < priv2->priority)
+ if (prio1 < prio2)
return 1;
/* fall back to bundle kind */
@@ -5143,7 +5146,7 @@ gs_app_get_priority (GsApp *app)
if (priv->priority == 0) {
g_autoptr(GsPlugin) plugin = gs_app_dup_management_plugin (app);
if (plugin != NULL)
- return gs_plugin_get_priority (plugin);
+ priv->priority = gs_plugin_get_priority (plugin);
}
return priv->priority;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]