[gnome-software/wip/debug-appstream-plugin-dirs] gs-plugin-appstream: Debug-print which directories are loaded



commit 600b7a1a48394fd382170e0ed1dcf54dc469291b
Author: Milan Crha <mcrha redhat com>
Date:   Mon Apr 11 17:57:11 2022 +0200

    gs-plugin-appstream: Debug-print which directories are loaded
    
    This can help to see, in the --verbose log, which directories
    the appstream plugin used to read its data from.

 plugins/core/gs-plugin-appstream.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 55569c1e0..f56352960 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -257,8 +257,12 @@ gs_plugin_appstream_load_appdata (GsPluginAppstream  *self,
        const gchar *fn;
        g_autoptr(GDir) dir = NULL;
        g_autoptr(GFile) parent = g_file_new_for_path (path);
-       if (!g_file_query_exists (parent, cancellable))
+       if (!g_file_query_exists (parent, cancellable)) {
+               g_debug ("appstream: Skipping appdata path '%s' as %s", path, g_cancellable_is_cancelled 
(cancellable) ? "cancelled" : "does not exist");
                return TRUE;
+       }
+
+       g_debug ("appstream: Loading appdata path '%s'", path);
 
        dir = g_dir_open (path, 0, error);
        if (dir == NULL)
@@ -362,8 +366,12 @@ gs_plugin_appstream_load_desktop (GsPluginAppstream  *self,
        const gchar *fn;
        g_autoptr(GDir) dir = NULL;
        g_autoptr(GFile) parent = g_file_new_for_path (path);
-       if (!g_file_query_exists (parent, cancellable))
+       if (!g_file_query_exists (parent, cancellable)) {
+               g_debug ("appstream: Skipping desktop path '%s' as %s", path, g_cancellable_is_cancelled 
(cancellable) ? "cancelled" : "does not exist");
                return TRUE;
+       }
+
+       g_debug ("appstream: Loading desktop path '%s'", path);
 
        dir = g_dir_open (path, 0, error);
        if (dir == NULL)
@@ -552,8 +560,11 @@ gs_plugin_appstream_load_appstream (GsPluginAppstream  *self,
        g_autoptr(GFile) parent = g_file_new_for_path (path);
 
        /* parent path does not exist */
-       if (!g_file_query_exists (parent, cancellable))
+       if (!g_file_query_exists (parent, cancellable)) {
+               g_debug ("appstream: Skipping appstream path '%s' as %s", path, g_cancellable_is_cancelled 
(cancellable) ? "cancelled" : "does not exist");
                return TRUE;
+       }
+       g_debug ("appstream: Loading appstream path '%s'", path);
        dir = g_dir_open (path, 0, error);
        if (dir == NULL)
                return FALSE;


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