[gnome-session] main: Remove GConf autostart support



commit 926c3fce17d9665047412046a7298fad55934b2d
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 16 14:45:06 2017 +0100

    main: Remove GConf autostart support
    
    We haven't used it since GNOME 3.0, and have had time to port
    applications in the 6 years since then.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787806

 gnome-session/README              |    2 +-
 gnome-session/gsm-autostart-app.c |   94 ++-----------------------------------
 meson.build                       |   13 -----
 meson_options.txt                 |    1 -
 4 files changed, 5 insertions(+), 105 deletions(-)
---
diff --git a/gnome-session/README b/gnome-session/README
index b401de2..f0bd4cc 100644
--- a/gnome-session/README
+++ b/gnome-session/README
@@ -12,7 +12,7 @@ represents an app resumed from the previous saved session.)
 Startup is divided into 7 phases (GsmManagerPhase):
 
     * GSM_MANAGER_PHASE_STARTUP covers gnome-session's internal
-      startup, which also includes starting gconfd and dbus-daemon (if
+      startup, which also includes starting dbus-daemon (if
       it's not already running). Gnome-session starts up those
       explicitly because it needs them for its own purposes.
 
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 870b151..e8b390b 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -28,10 +28,6 @@
 #include <gio/gio.h>
 #include <gio/gdesktopappinfo.h>
 
-#ifdef HAVE_GCONF
-#include <gconf/gconf-client.h>
-#endif
-
 #ifdef HAVE_SYSTEMD
 #include <systemd/sd-journal.h>
 #include <systemd/sd-daemon.h>
@@ -49,13 +45,10 @@ enum {
         GSM_CONDITION_NONE           = 0,
         GSM_CONDITION_IF_EXISTS      = 1,
         GSM_CONDITION_UNLESS_EXISTS  = 2,
-#ifdef HAVE_GCONF
-        GSM_CONDITION_GNOME          = 3,
-#endif
-        GSM_CONDITION_GSETTINGS      = 4,
-        GSM_CONDITION_IF_SESSION     = 5,
-        GSM_CONDITION_UNLESS_SESSION = 6,
-        GSM_CONDITION_UNKNOWN        = 7
+        GSM_CONDITION_GSETTINGS      = 3,
+        GSM_CONDITION_IF_SESSION     = 4,
+        GSM_CONDITION_UNLESS_SESSION = 5,
+        GSM_CONDITION_UNKNOWN        = 6
 };
 
 #define GSM_SESSION_CLIENT_DBUS_INTERFACE "org.gnome.SessionClient"
@@ -172,10 +165,6 @@ parse_condition_string (const char *condition_string,
                 kind = GSM_CONDITION_IF_EXISTS;
         } else if (!g_ascii_strncasecmp (condition_string, "unless-exists", len) && key) {
                 kind = GSM_CONDITION_UNLESS_EXISTS;
-#ifdef HAVE_GCONF
-        } else if (!g_ascii_strncasecmp (condition_string, "GNOME", len)) {
-                kind = GSM_CONDITION_GNOME;
-#endif
         } else if (!g_ascii_strncasecmp (condition_string, "GSettings", len)) {
                 kind = GSM_CONDITION_GSETTINGS;
         } else if (!g_ascii_strncasecmp (condition_string, "GNOME3", len)) {
@@ -270,40 +259,6 @@ unless_exists_condition_cb (GFileMonitor     *monitor,
         }
 }
 
-#ifdef HAVE_GCONF
-static void
-gconf_condition_cb (GConfClient *client,
-                    guint        cnxn_id,
-                    GConfEntry  *entry,
-                    gpointer     user_data)
-{
-        GsmApp                 *app;
-        GsmAutostartAppPrivate *priv;
-        gboolean                condition;
-
-        g_return_if_fail (GSM_IS_APP (user_data));
-
-        app = GSM_APP (user_data);
-
-        priv = GSM_AUTOSTART_APP (app)->priv;
-
-        condition = FALSE;
-        if (entry->value != NULL && entry->value->type == GCONF_VALUE_BOOL) {
-                condition = gconf_value_get_bool (entry->value);
-        }
-
-        g_debug ("GsmAutostartApp: app:%s condition changed condition:%d",
-                 gsm_app_peek_id (app),
-                 condition);
-
-        /* Emit only if the condition actually changed */
-        if (condition != priv->condition) {
-                priv->condition = condition;
-                g_signal_emit (app, signals[CONDITION_CHANGED], 0, condition);
-        }
-}
-#endif
-
 static void
 gsettings_condition_cb (GSettings  *settings,
                         const char *key,
@@ -490,16 +445,6 @@ setup_condition_monitor (GsmAutostartApp *app)
                 g_file_monitor_cancel (app->priv->condition_monitor);
         }
 
-#ifdef HAVE_GCONF
-        if (app->priv->condition_notify_id > 0) {
-                GConfClient *client;
-                client = gconf_client_get_default ();
-                gconf_client_notify_remove (client,
-                                            app->priv->condition_notify_id);
-                app->priv->condition_notify_id = 0;
-        }
-#endif
-
         if (app->priv->condition_string == NULL) {
                 return;
         }
@@ -552,29 +497,6 @@ setup_condition_monitor (GsmAutostartApp *app)
 
                 g_object_unref (file);
                 g_free (file_path);
-#ifdef HAVE_GCONF
-        } else if (kind == GSM_CONDITION_GNOME) {
-                GConfClient *client;
-                char        *dir;
-
-                client = gconf_client_get_default ();
-                g_assert (GCONF_IS_CLIENT (client));
-
-                disabled = !gconf_client_get_bool (client, key, NULL);
-
-                dir = g_path_get_dirname (key);
-
-                gconf_client_add_dir (client,
-                                      dir,
-                                      GCONF_CLIENT_PRELOAD_NONE, NULL);
-                g_free (dir);
-
-                app->priv->condition_notify_id = gconf_client_notify_add (client,
-                                                                          key,
-                                                                          gconf_condition_cb,
-                                                                          app, NULL, NULL);
-                g_object_unref (client);
-#endif
         } else if (kind == GSM_CONDITION_GSETTINGS) {
                 disabled = !setup_gsettings_condition_monitor (app, key);
         } else if (kind == GSM_CONDITION_IF_SESSION) {
@@ -850,14 +772,6 @@ is_conditionally_disabled (GsmApp *app)
                 file_path = resolve_conditional_file_path (key);
                 disabled = g_file_test (file_path, G_FILE_TEST_EXISTS);
                 g_free (file_path);
-#ifdef HAVE_GCONF
-        } else if (kind == GSM_CONDITION_GNOME) {
-                GConfClient *client;
-                client = gconf_client_get_default ();
-                g_assert (GCONF_IS_CLIENT (client));
-                disabled = !gconf_client_get_bool (client, key, NULL);
-                g_object_unref (client);
-#endif
         } else if (kind == GSM_CONDITION_GSETTINGS &&
                    priv->condition_settings != NULL) {
                 char **elems;
diff --git a/meson.build b/meson.build
index 016541f..17c1c75 100644
--- a/meson.build
+++ b/meson.build
@@ -109,8 +109,6 @@ common_flags = ['-DHAVE_CONFIG_H']
 enable_deprecation_flags = get_option('enable-deprecation-flags')
 if enable_deprecation_flags
   common_flags += [
-    '-DGCONF_DISABLE_DEPRECATED',
-    '-DGCONF_DISABLE_SINGLE_INCLUDES',
     '-DBONOBO_DISABLE_DEPRECATED',
     '-DBONOBO_DISABLE_SINGLE_INCLUDES',
     '-DBONOBO_UI_DISABLE_DEPRECATED',
@@ -178,16 +176,6 @@ session_bin_deps = session_deps + [
 
 enable_session_selector = get_option('enable-session-selector')
 
-# Check for gconf
-enable_gconf = get_option('enable-gconf')
-if enable_gconf
-  gconf_dep = dependency('gconf-2.0', required: false)
-  assert(gconf_dep.found(), 'GConf support explicitly required, but gconf not found')
-
-  session_bin_deps += gconf_dep
-endif
-config_h.set('HAVE_GCONF', enable_gconf)
-
 # Check for systemd
 session_tracking = 'null backend'
 
@@ -349,7 +337,6 @@ output += '        compiler:                 ' + cc.get_id() + '\n'
 output += '        cflags:                   ' + ' '.join(compiler_flags) + '\n'
 output += '        Debug mode:               ' + session_debug.to_string() + '\n'
 output += '        Use *_DISABLE_DEPRECATED: ' + enable_deprecation_flags.to_string() + '\n\n'
-output += '        GConf support:            ' + enable_gconf.to_string() + '\n'
 output += '        Session tracking:         ' + session_tracking + ' \n'
 output += '        IPv6 support:             ' + have_ipv6.to_string() + '\n'
 output += '        XRender support:          ' + have_xrender.to_string() + '\n'
diff --git a/meson_options.txt b/meson_options.txt
index 7cadb91..0e777ba 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,5 @@
 option('enable-deprecation-flags', type: 'boolean', value: false, description: 'use *_DISABLE_DEPRECATED 
flags')
 option('enable-session-selector', type: 'boolean', value: false, description: 'enable building a custom 
session selector dialog')
-option('enable-gconf', type: 'boolean', value: false, description: 'Support gconf-based autostart')
 option('enable-systemd', type: 'boolean', value: false, description: 'Use systemd')
 option('enable-consolekit', type: 'boolean', value: false, description: 'Use consolekit')
 option('enable-docbook', type: 'boolean', value: false, description: 'build documentation')


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