[gnome-settings-daemon] main: Remove _stop() function



commit 14c67b60b2f9c23ff775ed0807df513530d4a76e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jul 24 15:11:12 2013 +0200

    main: Remove _stop() function
    
    We'll just dispose the manager afterwards, so let the caller
    do that instead of introducing another way to do it.

 gnome-settings-daemon/gnome-settings-manager.c |   18 ++++++------------
 gnome-settings-daemon/gnome-settings-manager.h |    1 -
 gnome-settings-daemon/main.c                   |   18 +++---------------
 3 files changed, 9 insertions(+), 28 deletions(-)
---
diff --git a/gnome-settings-daemon/gnome-settings-manager.c b/gnome-settings-daemon/gnome-settings-manager.c
index 01db943..3058535 100644
--- a/gnome-settings-daemon/gnome-settings-manager.c
+++ b/gnome-settings-daemon/gnome-settings-manager.c
@@ -421,9 +421,13 @@ gnome_settings_manager_start (GnomeSettingsManager *manager,
         return ret;
 }
 
-void
-gnome_settings_manager_stop (GnomeSettingsManager *manager)
+static void
+gnome_settings_manager_dispose (GObject *object)
 {
+        GnomeSettingsManager *manager;
+
+        manager = GNOME_SETTINGS_MANAGER (object);
+
         g_debug ("Stopping settings manager");
 
         _unload_all (manager);
@@ -446,16 +450,6 @@ gnome_settings_manager_stop (GnomeSettingsManager *manager)
         g_clear_object (&manager->priv->settings);
         g_clear_object (&manager->priv->pnp_ids);
         g_clear_object (&manager->priv->connection);
-}
-
-static void
-gnome_settings_manager_dispose (GObject *object)
-{
-        GnomeSettingsManager *manager;
-
-        manager = GNOME_SETTINGS_MANAGER (object);
-
-        gnome_settings_manager_stop (manager);
 
         G_OBJECT_CLASS (gnome_settings_manager_parent_class)->dispose (object);
 }
diff --git a/gnome-settings-daemon/gnome-settings-manager.h b/gnome-settings-daemon/gnome-settings-manager.h
index be0a69c..36a283d 100644
--- a/gnome-settings-daemon/gnome-settings-manager.h
+++ b/gnome-settings-daemon/gnome-settings-manager.h
@@ -63,7 +63,6 @@ GType                  gnome_settings_manager_get_type   (void);
 GnomeSettingsManager * gnome_settings_manager_new        (void);
 gboolean               gnome_settings_manager_start      (GnomeSettingsManager *manager,
                                                           GError              **error);
-void                   gnome_settings_manager_stop       (GnomeSettingsManager *manager);
 
 G_END_DECLS
 
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index 16017df..353b558 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -64,13 +64,6 @@ timed_exit_cb (void)
 }
 
 static void
-stop_manager (GnomeSettingsManager *manager)
-{
-        gnome_settings_manager_stop (manager);
-        gtk_main_quit ();
-}
-
-static void
 on_session_over (GDBusProxy *proxy,
                  gchar      *sender_name,
                  gchar      *signal_name,
@@ -79,7 +72,7 @@ on_session_over (GDBusProxy *proxy,
 {
         if (g_strcmp0 (signal_name, "SessionOver") == 0) {
                 g_debug ("Got a SessionOver signal - stopping");
-                stop_manager (manager);
+                gtk_main_quit ();
         }
 }
 
@@ -109,7 +102,7 @@ client_proxy_signal_cb (GDBusProxy *proxy,
                 respond_to_end_session (proxy);
         } else if (g_strcmp0 (signal_name, "Stop") == 0) {
                 g_debug ("Got Stop signal");
-                stop_manager (manager);
+                gtk_main_quit ();
         }
 }
 
@@ -369,9 +362,6 @@ name_lost_handler (GDBusConnection *connection,
 
         g_warning ("Name taken or bus went away - shutting down");
 
-        if (manager != NULL)
-                stop_manager (manager);
-
         gtk_main_quit ();
 
 }
@@ -485,9 +475,7 @@ main (int argc, char *argv[])
                 name_id = 0;
         }
 
-        if (manager != NULL) {
-                g_object_unref (manager);
-        }
+        g_clear_object (&manager);
 
         g_debug ("SettingsDaemon finished");
         gnome_settings_profile_end (NULL);


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