[gnome-settings-daemon] common: Remove use of SCHEMA_NAME



commit d0cc917808fc3c8df5379d96fe32cb6dd67f28c1
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Sep 27 11:22:12 2016 +0200

    common: Remove use of SCHEMA_NAME
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772370

 plugins/common/daemon-skeleton.h |   57 +-------------------------------------
 plugins/wacom/Makefile.am        |    1 -
 2 files changed, 1 insertions(+), 57 deletions(-)
---
diff --git a/plugins/common/daemon-skeleton.h b/plugins/common/daemon-skeleton.h
index 7cd015d..9b14268 100644
--- a/plugins/common/daemon-skeleton.h
+++ b/plugins/common/daemon-skeleton.h
@@ -17,10 +17,6 @@
 #include <gtk/gtk.h>
 #include <libnotify/notify.h>
 
-#ifndef SCHEMA_NAME
-#define SCHEMA_NAME PLUGIN_NAME
-#endif
-
 #ifndef PLUGIN_NAME
 #error Include PLUGIN_CFLAGS in the daemon s CFLAGS
 #endif /* !PLUGIN_NAME */
@@ -35,49 +31,10 @@ static GOptionEntry entries[] = {
         {NULL}
 };
 
-static gboolean
-is_schema (const char *schema)
-{
-        GSettingsSchemaSource *source = NULL;
-        gchar **non_relocatable = NULL;
-        gchar **relocatable = NULL;
-        gboolean installed = FALSE;
-
-        source = g_settings_schema_source_get_default ();
-        if (!source)
-                return FALSE;
-
-        g_settings_schema_source_list_schemas (source, TRUE, &non_relocatable, &relocatable);
-
-        if (g_strv_contains ((const gchar * const *)non_relocatable, schema) ||
-            g_strv_contains ((const gchar * const *)relocatable, schema))
-                installed = TRUE;
-
-        g_strfreev (non_relocatable);
-        g_strfreev (relocatable);
-        return installed;
-}
-
-static gboolean
-has_settings (void)
-{
-  return is_schema ("org.gnome.settings-daemon.plugins." SCHEMA_NAME);
-}
-
-static void
-print_enable_disable_help (void)
-{
-       fprintf (stderr, "To deactivate:\n");
-       fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active false\n");
-       fprintf (stderr, "To reactivate:\n");
-       fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active true\n");
-}
-
 int
 main (int argc, char **argv)
 {
         GError  *error;
-        GSettings *settings;
 
         bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -87,7 +44,7 @@ main (int argc, char **argv)
        gdk_set_allowed_backends ("x11");
 
         error = NULL;
-        if (! gtk_init_with_args (&argc, &argv, SCHEMA_NAME, entries, NULL, &error)) {
+        if (! gtk_init_with_args (&argc, &argv, PLUGIN_NAME, entries, NULL, &error)) {
                 fprintf (stderr, "%s\n", error->message);
                 g_error_free (error);
                 exit (1);
@@ -102,18 +59,6 @@ main (int argc, char **argv)
                g_source_set_name_by_id (id, "[gnome-settings-daemon] gtk_main_quit");
        }
 
-       if (has_settings () == FALSE) {
-               fprintf (stderr, "The schemas for plugin '%s' isn't available, check your installation.\n", 
SCHEMA_NAME);
-       } else {
-               settings = g_settings_new ("org.gnome.settings-daemon.plugins." SCHEMA_NAME);
-               if (g_settings_get_boolean (settings, "active") != FALSE) {
-                       fprintf (stderr, "Plugin '%s' is not disabled. You need to disable it before 
launching the test application.\n", SCHEMA_NAME);
-                       print_enable_disable_help ();
-                       exit (1);
-               }
-               print_enable_disable_help();
-       }
-
         manager = NEW ();
 
         error = NULL;
diff --git a/plugins/wacom/Makefile.am b/plugins/wacom/Makefile.am
index 04e24bf..646dc88 100644
--- a/plugins/wacom/Makefile.am
+++ b/plugins/wacom/Makefile.am
@@ -73,7 +73,6 @@ gsd_wacom_CPPFLAGS = \
        -DGTKBUILDERDIR=\""$(pkgdatadir)"\"                     \
        -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"      \
        -DLIBEXECDIR=\""$(libexecdir)"\"                        \
-       -DSCHEMA_NAME=\""gsdwacom"\"                            \
        $(AM_CPPFLAGS)
 
 gsd_wacom_CFLAGS =                     \


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