[gnome-software: 24/25] appstream: Ensure state is always refined when refining an app




commit 606d0c2a8017ee3652f17c3863ff67b4335e243e
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Feb 28 19:47:39 2022 +0000

    appstream: Ensure state is always refined when refining an app
    
    This makes these two call sites of `gs_appstream_refine_app()` match the
    other call site, where `gs_plugin_appstream_set_compulsory_quirk()` and
    `gs_plugin_appstream_refine_state()` are also called.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 plugins/core/gs-plugin-appstream.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index cde6a5c2c..e67a94290 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -1090,6 +1090,12 @@ gs_plugin_refine_from_pkgname (GsPluginAppstream    *self,
                gs_plugin_appstream_set_compulsory_quirk (app, component);
        }
 
+       /* if an installed desktop or appdata file exists set to installed */
+       if (gs_app_get_state (app) == GS_APP_STATE_UNKNOWN) {
+               if (!gs_plugin_appstream_refine_state (self, app, error))
+                       return FALSE;
+       }
+
        /* success */
        return TRUE;
 }
@@ -1245,6 +1251,14 @@ refine_wildcard (GsPluginAppstream    *self,
                if (!gs_appstream_refine_app (GS_PLUGIN (self), new, self->silo, component,
                                              refine_flags, error))
                        return FALSE;
+               gs_plugin_appstream_set_compulsory_quirk (new, component);
+
+               /* if an installed desktop or appdata file exists set to installed */
+               if (gs_app_get_state (new) == GS_APP_STATE_UNKNOWN) {
+                       if (!gs_plugin_appstream_refine_state (self, new, error))
+                               return FALSE;
+               }
+
                gs_app_list_add (list, new);
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]