[network-manager-applet] applet: don't check for gnome shell (bgo #707953)



commit 4473e6a48fcfda1d87d4a4bc9f5c0589235dcfe0
Author: Pavel Šimerda <psimerda redhat com>
Date:   Fri May 23 15:58:51 2014 +0200

    applet: don't check for gnome shell (bgo #707953)
    
    The applet is no  longer autostarted under GNOME Shell, so it's pointless
    to keep the shell watcher code around.  The only reason it was autostarted
    was to handle VPN secrets (which GNOME Shell 3.0+ now does) and to auto-
    unlock WWAN devices, which GNOME Shell does not yet do.  It has been
    determined that should be handled differently, regardless of whether or
    not GNOME Shell is running, since the auto-unlocking behavior really
    annoys some users.
    
    Also, the check only cares about GNOME Shell < 3.0, and 3.0 was released
    in early 2011.  It's highly unlikely that anyone is using such an old
    version of GNOME Shell with the latest nm-applet.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707953
    
    (commit message by dcbw)

 src/applet.c        |   47 +----------
 src/applet.h        |    4 -
 src/shell-watcher.c |  241 ---------------------------------------------------
 src/shell-watcher.h |   56 ------------
 4 files changed, 1 insertions(+), 347 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index f3f4344..f0536f8 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -87,7 +87,6 @@
 #include "nm-wifi-dialog.h"
 #include "applet-vpn-request.h"
 #include "utils.h"
-#include "shell-watcher.h"
 #include "nm-ui-utils.h"
 
 #if WITH_MODEM_MANAGER_1
@@ -3543,39 +3542,6 @@ register_agent (NMApplet *applet)
                          G_CALLBACK (applet_agent_cancel_secrets_cb), applet);
 }
 
-static void
-shell_version_changed_cb (NMShellWatcher *watcher, GParamSpec *pspec, gpointer user_data)
-{
-       NMApplet *applet = user_data;
-
-       if (nm_shell_watcher_version_at_least (watcher, 3, 0)) {
-               g_debug ("gnome-shell is running");
-
-               if (applet->agent) {
-                       g_debug ("destroying secret agent");
-
-                       g_signal_handlers_disconnect_by_func (applet->agent,
-                                                             G_CALLBACK (applet_agent_get_secrets_cb),
-                                                             applet);
-                       g_signal_handlers_disconnect_by_func (applet->agent,
-                                                             G_CALLBACK (applet_agent_cancel_secrets_cb),
-                                                             applet);
-                       nm_secret_agent_unregister (NM_SECRET_AGENT (applet->agent));
-                       g_clear_object (&applet->agent);
-               }
-
-               /* We don't need the watcher any more */
-               g_signal_handlers_disconnect_by_func (applet->shell_watcher,
-                                                     G_CALLBACK (shell_version_changed_cb),
-                                                     applet);
-               g_clear_object (&applet->shell_watcher);
-       } else if (!applet->agent) {
-               /* No shell */
-               g_debug ("gnome-shell is not running, registering secret agent");
-               register_agent (applet);
-       }
-}
-
 static gboolean
 dbus_setup (NMApplet *applet, GError **error)
 {
@@ -3728,15 +3694,7 @@ initable_init (GInitable *initable, GCancellable *cancellable, GError **error)
                          G_CALLBACK (applet_embedded_cb), NULL);
        applet_embedded_cb (G_OBJECT (applet->status_icon), NULL, NULL);
 
-       /* Watch GNOME Shell so we can unregister our applet agent if it appears */
-       if (!shell_debug) {
-               applet->shell_watcher = nm_shell_watcher_new ();
-               g_signal_connect (applet->shell_watcher,
-                                     "notify::shell-version",
-                                     G_CALLBACK (shell_version_changed_cb),
-                                     applet);
-       } else
-               register_agent (applet);
+       register_agent (applet);
 
        return TRUE;
 }
@@ -3806,9 +3764,6 @@ static void finalize (GObject *object)
        if (applet->session_bus)
                dbus_g_connection_unref (applet->session_bus);
 
-       if (applet->shell_watcher)
-               g_object_unref (applet->shell_watcher);
-
        G_OBJECT_CLASS (nma_parent_class)->finalize (object);
 }
 
diff --git a/src/applet.h b/src/applet.h
index cd5ac97..23632f7 100644
--- a/src/applet.h
+++ b/src/applet.h
@@ -44,7 +44,6 @@
 #include <nm-active-connection.h>
 #include <nm-remote-settings.h>
 #include "applet-agent.h"
-#include "shell-watcher.h"
 
 #if WITH_MODEM_MANAGER_1
 #include <libmm-glib.h>
@@ -87,9 +86,6 @@ typedef struct
        GMainLoop *loop;
        DBusGConnection *session_bus;
 
-       NMShellWatcher *shell_watcher;
-       guint agent_start_id;
-
        NMClient *nm_client;
        NMRemoteSettings *settings;
        AppletAgent *agent;


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