[gvfs] client: Remove unused code for dbus vfs filters



commit 8d08c558cda63e864ffd1c960435ea5332c884bd
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Sep 26 12:35:27 2013 +0200

    client: Remove unused code for dbus vfs filters
    
    This code is not used anymore
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708744

 client/gdaemonfile.c        |    3 -
 client/gdaemonfilemonitor.c |    1 -
 client/gdaemonmount.c       |    1 -
 client/gvfsdaemondbus.c     |  104 -------------------------------------------
 client/gvfsdaemondbus.h     |    5 --
 client/gvfsiconloadable.c   |    3 -
 6 files changed, 0 insertions(+), 117 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index a396211..75e9053 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -487,8 +487,6 @@ create_proxy_for_file2 (GFile *file1,
   
   /* Set infinite timeout, see bug 687534 */
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), G_MAXINT);
-  
-  _g_dbus_connect_vfs_filters (connection);
 
   if (mount_info1_out)
     *mount_info1_out = g_mount_info_ref (mount_info1);
@@ -594,7 +592,6 @@ async_proxy_new_cb (GObject *source_object,
   /* Set infinite timeout, see bug 687534 */
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (data->proxy), G_MAXINT);
 
-  _g_dbus_connect_vfs_filters (data->connection);
   path = g_mount_info_resolve_path (data->mount_info, daemon_file->path);
 
   /* Complete the create_proxy_for_file_async() call */
diff --git a/client/gdaemonfilemonitor.c b/client/gdaemonfilemonitor.c
index e58bbb7..4de3b24 100644
--- a/client/gdaemonfilemonitor.c
+++ b/client/gdaemonfilemonitor.c
@@ -162,7 +162,6 @@ subscribe_cb (GVfsDBusMonitor *proxy,
       return;
     }
 
-  _g_dbus_connect_vfs_filters (monitor->connection);
   monitor->proxy = g_object_ref (proxy);
 
   g_object_unref (monitor);
diff --git a/client/gdaemonmount.c b/client/gdaemonmount.c
index ca77648..e4acef0 100644
--- a/client/gdaemonmount.c
+++ b/client/gdaemonmount.c
@@ -243,7 +243,6 @@ async_proxy_new_cb (GObject *source_object,
     }
 
   data->proxy = proxy;
-  _g_dbus_connect_vfs_filters (data->connection);
 
   mount_source = g_mount_operation_dbus_wrap (data->mount_operation, _g_daemon_vfs_get_async_bus ());
 
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index a31e9d3..bcf96d0 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -63,110 +63,6 @@ _g_vfs_error_quark (void)
   return g_quark_from_static_string ("g-vfs-error-quark");
 }
 
-/**************************************************************************
- *               message filters for vfs dbus connections                 *
- *************************************************************************/
-
-typedef struct {
-  GVfsRegisterVfsFilterCallback callback;
-  GObject *data;
-  GHashTable *skeletons;
-} PathMapEntry;
-
-static void
-free_path_map_entry (PathMapEntry *entry)
-{
-  g_hash_table_destroy (entry->skeletons);
-  g_free (entry);
-}
-
-static void
-unref_skeleton (gpointer object)
-{
-  GDBusInterfaceSkeleton *skeleton = object;
-
-  g_dbus_interface_skeleton_unexport (skeleton);
-  g_object_unref (skeleton);
-}
-
-/*  Please note the obj_path has to be unique even for different interfaces  */
-void
-_g_dbus_register_vfs_filter (const char *obj_path,
-                             GVfsRegisterVfsFilterCallback callback,
-                            GObject *data)
-{
-  PathMapEntry *entry;
-
-  G_LOCK (obj_path_map);
-  
-  if (obj_path_map == NULL)
-    obj_path_map = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                         g_free, (GDestroyNotify)free_path_map_entry);
-
-  entry = g_new (PathMapEntry, 1);
-  entry->callback = callback;
-  entry->data = data;
-  entry->skeletons = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, 
(GDestroyNotify)unref_skeleton);
-
-  g_hash_table_insert (obj_path_map, g_strdup (obj_path), entry);
-  
-  G_UNLOCK (obj_path_map);
-}
-
-void
-_g_dbus_unregister_vfs_filter (const char *obj_path)
-{
-  G_LOCK (obj_path_map);
-
-  if (obj_path_map)
-      g_hash_table_remove (obj_path_map, obj_path);
-  
-  G_UNLOCK (obj_path_map);
-}
-
-static void
-register_skeleton (const char *obj_path,
-                   PathMapEntry *entry,
-                   GDBusConnection *dbus_conn)
-{
-  GDBusInterfaceSkeleton *skeleton;
-
-  if (! g_hash_table_contains (entry->skeletons, dbus_conn))
-    {
-      /* Note that the newly created GDBusInterfaceSkeleton instance refs the connection so it's not needed 
to watch for connection being destroyed */ 
-      skeleton = entry->callback (dbus_conn, obj_path, entry->data);
-      g_hash_table_insert (entry->skeletons, dbus_conn, skeleton);
-    }
-  else
-    {
-      /* Interface skeleton has already been registered on the connection, skipping */
-    }
-}
-
-/*
- *  Export registered interface skeletons on this connection. This should ideally
- *  be called only once for every connection, but we often share/reuse existing
- *  connections.
- *  
- *  Already exported interface skeletons should live as long as possible
- *  since there might be ongoing data transfer and re-exporting (unreffing + creation)
- *  breaks running jobs randomly.
- *  
- */
-void
-_g_dbus_connect_vfs_filters (GDBusConnection *connection)
-{
-  G_LOCK (obj_path_map);
-
-  if (obj_path_map)
-    {
-      /* Export new interface skeletons */
-      g_hash_table_foreach (obj_path_map, (GHFunc) register_skeleton, connection);
-    }
-
-  G_UNLOCK (obj_path_map);
-}
-
 static void
 connection_data_free (gpointer p)
 {
diff --git a/client/gvfsdaemondbus.h b/client/gvfsdaemondbus.h
index 68ed536..24f5056 100644
--- a/client/gvfsdaemondbus.h
+++ b/client/gvfsdaemondbus.h
@@ -48,11 +48,6 @@ typedef GDBusInterfaceSkeleton *  (*GVfsRegisterVfsFilterCallback)  (GDBusConnec
                                                                      gpointer         callback_data);
 
 
-void            _g_dbus_register_vfs_filter             (const char                     *obj_path,
-                                                        GVfsRegisterVfsFilterCallback   callback,
-                                                        GObject                        *data);
-void            _g_dbus_unregister_vfs_filter           (const char                     *obj_path);
-void            _g_dbus_connect_vfs_filters             (GDBusConnection                *connection);
 GDBusConnection *_g_dbus_connection_get_sync            (const char                     *dbus_id,
                                                          GCancellable                   *cancellable,
                                                         GError                        **error);
diff --git a/client/gvfsiconloadable.c b/client/gvfsiconloadable.c
index 9030a48..5822a3c 100644
--- a/client/gvfsiconloadable.c
+++ b/client/gvfsiconloadable.c
@@ -69,8 +69,6 @@ create_proxy_for_icon (GVfsIcon *vfs_icon,
   if (proxy == NULL)
     goto out;
   
-  _g_dbus_connect_vfs_filters (connection);
-
  out:
   if (mount_info)
     g_mount_info_unref (mount_info);
@@ -187,7 +185,6 @@ async_proxy_new_cb (GObject *source_object,
     }
   
   data->proxy = proxy;
-  _g_dbus_connect_vfs_filters (data->connection);
 
   data->callback (proxy,
                   data->result,


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