[gnome-software/wip/gs-plugin-appstream-ignore-refine-with-no-id: 90/90] gs-app: Print also app name when state change is invalid




commit 6a1bdc3418ae0828fb86601e1f56aa6f6939c72e
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jul 20 13:13:52 2022 +0200

    gs-app: Print also app name when state change is invalid
    
    Show also the GsApp::name in the runtime warning, for better recognition
    of the app. This helps for PackageKit apps, which do not have set the GsApp::id.
    
    It changes the (example) warning from
    
    >  State change on (null) from updatable to unavailable is not OK
    
    to
    
    >   State change on (null) (libhandy) from updatable to unavailable is not OK

 lib/gs-app.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 8d323b234..9af985001 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1182,8 +1182,9 @@ gs_app_set_state_internal (GsApp *app, GsAppState state)
 
        /* this state change was unexpected */
        if (!state_change_ok) {
-               g_warning ("State change on %s from %s to %s is not OK",
+               g_warning ("State change on %s (%s) from %s to %s is not OK",
                           gs_app_get_unique_id_unlocked (app),
+                          priv->name,
                           gs_app_state_to_string (priv->state),
                           gs_app_state_to_string (state));
        }


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