[gnome-applets/gnome-3-24] window-buttons: make two functions static



commit c4dc1b9d8ec4036cb1166f84d5d1b7855ea8bcb7
Author: Gabriel Finkelstein <gabrielfinkelstein gmail com>
Date:   Mon Mar 27 18:07:41 2017 -0300

    window-buttons: make two functions static
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770795

 window-buttons/external.c |   41 ++++++++++++++++++++---------------------
 1 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/window-buttons/external.c b/window-buttons/external.c
index 422a454..1d5c5fe 100755
--- a/window-buttons/external.c
+++ b/window-buttons/external.c
@@ -32,6 +32,25 @@ gboolean issetCompizDecoration(void);
 void toggleCompizDecoration(gboolean);
 //void toggleMetacityDecoration(gboolean); //TODO
 
+static gboolean gsettings_schema_exists (const gchar* schema) {
+       GSettingsSchemaSource *schema_source;
+       GSettingsSchema *schema_schema;
+       gboolean schema_exists;
+
+       schema_source = g_settings_schema_source_get_default();
+       schema_schema = g_settings_schema_source_lookup (schema_source, schema, TRUE);
+       schema_exists = (schema_schema != NULL);
+       if (schema_schema)
+               g_settings_schema_unref (schema_schema);
+
+       return schema_exists;
+}
+
+static gboolean decorPluginInstalled (void) {
+       return gsettings_schema_exists(GSETTINGS_COMPIZ_SCHEMA)
+               && gsettings_schema_exists(GSETTINGS_COMPIZ_DECOR_SCHEMA);
+}
+
 gchar *getMetacityLayout() {
        GSettings *gs = g_settings_new(GSETTINGS_METACITY_SCHEMA);
        gchar *retval = g_settings_get_string(gs, CFG_METACITY_BUTTON_LAYOUT);
@@ -71,7 +90,7 @@ gboolean issetCompizDecoration() {
 }
 
 void toggleCompizDecoration(gboolean new_value) {
-       if(!decorPluginInstalled()) return NULL;
+       if(!decorPluginInstalled()) return;
 
        GSettings *settings = g_settings_new(GSETTINGS_COMPIZ_SCHEMA);
        gchar *current_profile = g_settings_get_string(settings, CFG_COMPIZ_CURRENT_PROFILE);
@@ -89,23 +108,3 @@ void toggleCompizDecoration(gboolean new_value) {
        g_free(path);
        g_object_unref(settings);
 }
-
-// Check if Compiz and decor plugin are installed / schema exists
-gboolean decorPluginInstalled () {
-       return gsettings_schema_exists(GSETTINGS_COMPIZ_SCHEMA)
-               && gsettings_schema_exists(GSETTINGS_COMPIZ_DECOR_SCHEMA);
-}
-
-gboolean gsettings_schema_exists (const gchar* schema) {
-       GSettingsSchemaSource *schema_source;
-       GSettingsSchema *schema_schema;
-       gboolean schema_exists;
-
-       schema_source = g_settings_schema_source_get_default();
-       schema_schema = g_settings_schema_source_lookup (schema_source, schema, TRUE);
-       schema_exists = (schema_schema != NULL);
-       if (schema_schema)
-               g_settings_schema_unref (schema_schema);
-
-       return schema_exists;
-}


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