[gnome-settings-daemon/mount-plugin: 13/13] Revert "Show the devices panel when a volume is mounted"



commit 62036736610b1750cc3f997fe79de155f10c474b
Author: Ross Burton <ross linux intel com>
Date:   Thu Apr 1 22:44:04 2010 +0100

    Revert "Show the devices panel when a volume is mounted"
    
    This reverts commit 5d9ad385f4f62aefe785191db34e6c8c6517f26e.

 plugins/mount/gsd-mount-manager.c |   74 ++++++++++--------------------------
 1 files changed, 21 insertions(+), 53 deletions(-)
---
diff --git a/plugins/mount/gsd-mount-manager.c b/plugins/mount/gsd-mount-manager.c
index 257ea11..6fca1e8 100644
--- a/plugins/mount/gsd-mount-manager.c
+++ b/plugins/mount/gsd-mount-manager.c
@@ -25,15 +25,12 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
-#include <dbus/dbus-glib.h>
-
 #include "gsd-mount-manager.h"
 
 #define GSD_MOUNT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MOUNT_MANAGER, GsdMountManagerPrivate))
 
 struct GsdMountManagerPrivate
 {
-        DBusGConnection *session_bus;
         GVolumeMonitor *monitor;
         gboolean coldplugging;
 };
@@ -53,38 +50,6 @@ drive_connected_cb (GVolumeMonitor *monitor,
 #endif
 
 static void
-mount_added_cb (GVolumeMonitor *monitor,
-                GMount *mount,
-                GsdMountManager *manager)
-{
-        GFile *file;
-        char *uri;
-        DBusGProxy *proxy;
-
-        if (manager->priv->coldplugging)
-                return;
-
-        file = g_mount_get_root (mount);
-        uri = g_file_get_uri (file);
-        g_debug ("%s mounted, showing devices panel", uri);
-        g_free (uri);
-        g_object_unref (file);
-
-
-        if (manager->priv->session_bus) {
-                proxy = dbus_g_proxy_new_for_name (manager->priv->session_bus,
-                                                   "org.moblin.UX.Shell.Toolbar",
-                                                   "/org/moblin/UX/Shell/Toolbar",
-                                                   "org.moblin.UX.Shell.Toolbar");
-
-                dbus_g_proxy_call_no_reply (proxy, "ShowPanel",
-                                            G_TYPE_STRING, "devices", G_TYPE_INVALID);
-
-                g_object_unref (proxy);
-        }
-}
-
-static void
 volume_mounted_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
 {
         GsdMountManager *manager = GSD_MOUNT_MANAGER (user_data);
@@ -148,6 +113,26 @@ volume_added_cb (GVolumeMonitor *monitor,
 }
 
 static void
+mount_added_cb (GVolumeMonitor *monitor,
+                GMount *mount,
+                GsdMountManager *manager)
+{
+        GFile *file;
+        char *uri;
+
+        file = g_mount_get_root (mount);
+        uri = g_file_get_uri (file);
+
+        g_debug ("%s mounted, starting file manager", uri);
+
+        /* TODO: some sort of dialog */
+        /* gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL); */
+
+        g_free (uri);
+        g_object_unref (file);
+}
+
+static void
 mount_existing_volumes (GsdMountManager *manager)
 {
         /* TODO: iterate over drives to hook up eject */
@@ -179,22 +164,12 @@ mount_existing_volumes (GsdMountManager *manager)
 
 gboolean
 gsd_mount_manager_start (GsdMountManager *manager,
-                         GError         **error)
+                               GError               **error)
 {
-        GError *derror = NULL;
-
         g_debug ("Starting mount manager");
 
-        manager->priv->session_bus = dbus_g_bus_get (DBUS_BUS_SESSION, &derror);
-        if (manager->priv->session_bus == NULL) {
-                g_printerr ("Cannot connect to DBus: %s\n", derror->message);
-                g_error_free (derror);
-        }
-
         manager->priv->monitor = g_volume_monitor_get ();
 
-        manager->priv->coldplugging = FALSE;
-
 #if 0
 	g_signal_connect_object (manager->priv->monitor, "drive-connected",
 				 G_CALLBACK (drive_connected_cb), manager, 0);
@@ -215,13 +190,6 @@ void
 gsd_mount_manager_stop (GsdMountManager *manager)
 {
         g_debug ("Stopping mount manager");
-
-        /* TODO: disconnect signals */
-
-        g_object_unref (manager->priv->monitor);
-        manager->priv->monitor = NULL;
-
-        manager->priv->session_bus = NULL;
 }
 
 static void



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