[gnome-builder/gnome-builder-41] plugins: always check enabled status in gsettings



commit 4447986cc717bab7b1be437d933c31415eece013
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 8 17:04:23 2022 -0800

    plugins: always check enabled status in gsettings
    
    Even if we think we have a match, we still need to check gsettings to
    ensure that we are allowed to load the plugin type right now.
    
    Related #1621

 src/libide/plugins/ide-extension-util.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/plugins/ide-extension-util.c b/src/libide/plugins/ide-extension-util.c
index 11749b28a..d198f7e70 100644
--- a/src/libide/plugins/ide-extension-util.c
+++ b/src/libide/plugins/ide-extension-util.c
@@ -59,7 +59,7 @@ ide_extension_util_can_use_plugin (PeasEngine     *engine,
        */
       found = peas_plugin_info_get_external_data (plugin_info, key);
       if (ide_str_empty0 (found))
-        return TRUE;
+        goto check_gsettings;
 
       return FALSE;
     }
@@ -95,7 +95,7 @@ ide_extension_util_can_use_plugin (PeasEngine     *engine,
 
       /* An empty value implies "*" to match anything */
       if (!values || g_strv_contains ((const gchar * const *)values_array, "*"))
-        return TRUE;
+        goto check_gsettings;
 
       /* Otherwise actually check that the key/value matches */
       if (!g_strv_contains ((const gchar * const *)values_array, value))
@@ -107,6 +107,7 @@ ide_extension_util_can_use_plugin (PeasEngine     *engine,
         *priority = atoi (priority_value);
     }
 
+check_gsettings:
   /*
    * Ensure the plugin type isn't disabled by checking our GSettings
    * for the plugin type. There is an implicit plugin issue here, in that


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