[gnome-applets] window-buttons: make two functions static
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] window-buttons: make two functions static
- Date: Tue, 28 Mar 2017 11:23:58 +0000 (UTC)
commit 32403f25152208d4f30dc7e44c1943b4e948a886
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]