totem r5022 - in trunk: . src/plugins/media-player-keys



Author: fcrozat
Date: Tue Jan 15 12:45:07 2008
New Revision: 5022
URL: http://svn.gnome.org/viewvc/totem?rev=5022&view=rev

Log:
2008-01-15  Frederic Crozat  <fcrozat mandriva com>

        * src/plugins/media-player-keys/totem-media-player-keys.c:
        Prevent autostarting gnome-settings-daemon, only enable
        plugin if it is running already (Closes: #509438)



Modified:
   trunk/ChangeLog
   trunk/src/plugins/media-player-keys/totem-media-player-keys.c

Modified: trunk/src/plugins/media-player-keys/totem-media-player-keys.c
==============================================================================
--- trunk/src/plugins/media-player-keys/totem-media-player-keys.c	(original)
+++ trunk/src/plugins/media-player-keys/totem-media-player-keys.c	Tue Jan 15 12:45:07 2008
@@ -120,6 +120,13 @@
 	return FALSE;
 }
 
+static void
+proxy_destroy (DBusGProxy *proxy,
+		  TotemMediaPlayerKeysPlugin* plugin)
+{
+	plugin->media_player_keys_proxy = NULL;
+}
+
 static gboolean
 impl_activate (TotemPlugin *plugin,
 	       TotemObject *totem,
@@ -136,10 +143,22 @@
 		return FALSE;
 	}
 
-	pi->media_player_keys_proxy = dbus_g_proxy_new_for_name (connection,
+	pi->media_player_keys_proxy = dbus_g_proxy_new_for_name_owner (connection,
 			"org.gnome.SettingsDaemon", "/org/gnome/SettingsDaemon",
-			"org.gnome.SettingsDaemon");
+			"org.gnome.SettingsDaemon", &err);
 	dbus_g_connection_unref (connection);
+	if (err != NULL) {
+		g_warning ("Failed to create dbus proxy for org.gnome.SettingsDaemon: %s",
+				   err->message);
+		g_error_free (err);
+		return FALSE;
+	} else {
+		g_signal_connect_object (pi->media_player_keys_proxy,
+					 "destroy",
+					 G_CALLBACK (proxy_destroy),
+					 pi, 0);
+	}
+
 
 	org_gnome_SettingsDaemon_grab_media_player_keys (pi->media_player_keys_proxy,
 			"Totem", 0, NULL);



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