[gnome-software: 1/6] gs-external-appstream-utils: use external-appstream-system-wide key




commit 7e8a1978f0e297fc052456fbc5da9218a1389903
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date:   Tue Dec 28 20:03:00 2021 +0100

    gs-external-appstream-utils: use external-appstream-system-wide key
    
    The key had been defined when it was introduced, but it was not
    implemented in code. The logic that decided whether to install
    the external appstream files system-wide or just to the current
    user has a bug, where it read "external-appstream-urls" instead
    of "external-appstream-system-wide". This is fixed in this commit.
    
    Additionally, before the fix, the memory returned by g_settings_get_strv
    was never freed, causing a memory leak. Also, as "external-appstream-urls"
    must have been set for the code to reach gs_external_appstream_refresh_url,
    gs_external_appstream_refresh_user was dead code. This is also fixed
    in this commit

 lib/gs-external-appstream-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/gs-external-appstream-utils.c b/lib/gs-external-appstream-utils.c
index e227d77b5..bc1b6a3fc 100644
--- a/lib/gs-external-appstream-utils.c
+++ b/lib/gs-external-appstream-utils.c
@@ -257,7 +257,7 @@ gs_external_appstream_refresh_url (GsPlugin      *plugin,
                                    GCancellable  *cancellable,
                                    GError       **error)
 {
-       if (g_settings_get_strv (settings, "external-appstream-urls")) {
+       if (g_settings_get_boolean (settings, "external-appstream-system-wide")) {
                return gs_external_appstream_refresh_sys (plugin, url,
                                                          cache_age,
                                                          cancellable,


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