diff options
author | David Zeuthen <davidz@redhat.com> | 2007-12-11 21:27:29 +0000 |
---|---|---|
committer | David Zeuthen <davidz@src.gnome.org> | 2007-12-11 21:27:29 +0000 |
commit | 31211bb7c4de6f929021500c87a18982757fd703 (patch) | |
tree | f214233346604d35132897e8269940ecdd3fdade | |
parent | d999ba24fc11a918c14f1ec30dd54c9f72e1b02e (diff) | |
download | gvfs-31211bb7c4de6f929021500c87a18982757fd703.tar.gz |
Update for API changes in gio trunk.
2007-12-11 David Zeuthen <davidz@redhat.com>
Update for API changes in gio trunk.
* client/Makefile.am:
* client/gdaemonfile.c: (g_daemon_file_find_enclosing_mount),
(g_daemon_file_file_iface_init):
* client/gdaemonvolumemonitor.c: (get_mounts), (get_volumes),
(find_mount_by_mount_info), (mount_added), (mount_removed),
(g_daemon_volume_monitor_init), (g_daemon_volume_monitor_finalize),
(g_daemon_volume_monitor_class_init):
* client/gdaemonvolumemonitor.h:
* client/gvfsfusedaemon.c: (mount_record_new),
(mount_record_for_mount_exists), (mount_list_update),
(mount_tracker_mounted_cb), (mount_tracker_unmounted_cb),
(subthread_main):
* daemon/gvfsbackendtrash.c: (list_trash_dirs):
svn path=/trunk/; revision=1037
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | client/Makefile.am | 2 | ||||
-rw-r--r-- | client/gdaemonfile.c | 22 | ||||
-rw-r--r-- | client/gdaemonmount.c (renamed from client/gdaemonvolume.c) | 108 | ||||
-rw-r--r-- | client/gdaemonmount.h (renamed from client/gdaemonvolume.h) | 28 | ||||
-rw-r--r-- | client/gdaemonvolumemonitor.c | 70 | ||||
-rw-r--r-- | client/gdaemonvolumemonitor.h | 1 | ||||
-rw-r--r-- | client/gvfsfusedaemon.c | 44 | ||||
-rw-r--r-- | daemon/gvfsbackendtrash.c | 2 |
9 files changed, 161 insertions, 134 deletions
@@ -1,3 +1,21 @@ +2007-12-11 David Zeuthen <davidz@redhat.com> + + Update for API changes in gio trunk. + + * client/Makefile.am: + * client/gdaemonfile.c: (g_daemon_file_find_enclosing_mount), + (g_daemon_file_file_iface_init): + * client/gdaemonvolumemonitor.c: (get_mounts), (get_volumes), + (find_mount_by_mount_info), (mount_added), (mount_removed), + (g_daemon_volume_monitor_init), (g_daemon_volume_monitor_finalize), + (g_daemon_volume_monitor_class_init): + * client/gdaemonvolumemonitor.h: + * client/gvfsfusedaemon.c: (mount_record_new), + (mount_record_for_mount_exists), (mount_list_update), + (mount_tracker_mounted_cb), (mount_tracker_unmounted_cb), + (subthread_main): + * daemon/gvfsbackendtrash.c: (list_trash_dirs): + 2007-12-05 Alexander Larsson <alexl@redhat.com> * client/gdaemonvfs.c: diff --git a/client/Makefile.am b/client/Makefile.am index 101e6e2a..b63465f7 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -24,7 +24,7 @@ URI_PARSER_SOURCES = \ vfssources = \ gdaemonvfs.c gdaemonvfs.h \ - gdaemonvolume.c gdaemonvolume.h \ + gdaemonmount.c gdaemonmount.h \ gdaemonvolumemonitor.c gdaemonvolumemonitor.h \ gdaemonfile.c gdaemonfile.h \ gdaemonfileinputstream.c gdaemonfileinputstream.h \ diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index 0d77f11d..c70adcd3 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -30,7 +30,7 @@ #include "gdaemonfile.h" #include "gvfsdaemondbus.h" -#include "gdaemonvolume.h" +#include "gdaemonmount.h" #include <gvfsdaemonprotocol.h> #include <gdaemonfileinputstream.h> #include <gdaemonfileoutputstream.h> @@ -1422,14 +1422,14 @@ g_daemon_file_query_filesystem_info (GFile *file, return info; } -static GVolume * -g_daemon_file_find_enclosing_volume (GFile *file, - GCancellable *cancellable, - GError **error) +static GMount * +g_daemon_file_find_enclosing_mount (GFile *file, + GCancellable *cancellable, + GError **error) { GDaemonFile *daemon_file = G_DAEMON_FILE (file); GMountInfo *mount_info; - GDaemonVolume *volume; + GDaemonMount *mount; mount_info = _g_daemon_vfs_get_mount_info_sync (daemon_file->mount_spec, daemon_file->path, @@ -1439,16 +1439,16 @@ g_daemon_file_find_enclosing_volume (GFile *file, if (mount_info->user_visible) { - volume = g_daemon_volume_new (mount_info); + mount = g_daemon_mount_new (mount_info); g_mount_info_unref (mount_info); - if (volume) - return G_VOLUME (volume); + if (mount) + return G_MOUNT (mount); } g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, - _("Containing volume does not exist")); + _("Containing mount does not exist")); return NULL; } @@ -1958,7 +1958,7 @@ g_daemon_file_file_iface_init (GFileIface *iface) iface->query_info = g_daemon_file_query_info; iface->query_info_async = g_daemon_file_query_info_async; iface->query_info_finish = g_daemon_file_query_info_finish; - iface->find_enclosing_volume = g_daemon_file_find_enclosing_volume; + iface->find_enclosing_mount = g_daemon_file_find_enclosing_mount; iface->read_fn = g_daemon_file_read; iface->append_to = g_daemon_file_append_to; iface->create = g_daemon_file_create; diff --git a/client/gdaemonvolume.c b/client/gdaemonmount.c index b54f3683..0f4f7984 100644 --- a/client/gdaemonvolume.c +++ b/client/gdaemonmount.c @@ -29,107 +29,107 @@ #include <gio/gthemedicon.h> #include <gio/gsimpleasyncresult.h> #include "gdaemonvolumemonitor.h" -#include "gdaemonvolume.h" +#include "gdaemonmount.h" #include "gvfsdaemondbus.h" #include "gdaemonfile.h" #include "gvfsdaemonprotocol.h" -struct _GDaemonVolume { +struct _GDaemonMount { GObject parent; GMountInfo *mount_info; }; -static void g_daemon_volume_volume_iface_init (GVolumeIface *iface); +static void g_daemon_mount_mount_iface_init (GMountIface *iface); -G_DEFINE_TYPE_WITH_CODE (GDaemonVolume, g_daemon_volume, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (G_TYPE_VOLUME, - g_daemon_volume_volume_iface_init)) +G_DEFINE_TYPE_WITH_CODE (GDaemonMount, g_daemon_mount, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_MOUNT, + g_daemon_mount_mount_iface_init)) static void -g_daemon_volume_finalize (GObject *object) +g_daemon_mount_finalize (GObject *object) { - GDaemonVolume *volume; + GDaemonMount *mount; - volume = G_DAEMON_VOLUME (object); + mount = G_DAEMON_MOUNT (object); - g_mount_info_unref (volume->mount_info); + g_mount_info_unref (mount->mount_info); - if (G_OBJECT_CLASS (g_daemon_volume_parent_class)->finalize) - (*G_OBJECT_CLASS (g_daemon_volume_parent_class)->finalize) (object); + if (G_OBJECT_CLASS (g_daemon_mount_parent_class)->finalize) + (*G_OBJECT_CLASS (g_daemon_mount_parent_class)->finalize) (object); } static void -g_daemon_volume_class_init (GDaemonVolumeClass *klass) +g_daemon_mount_class_init (GDaemonMountClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = g_daemon_volume_finalize; + gobject_class->finalize = g_daemon_mount_finalize; } static void -g_daemon_volume_init (GDaemonVolume *daemon_volume) +g_daemon_mount_init (GDaemonMount *daemon_mount) { } -GDaemonVolume * -g_daemon_volume_new (GMountInfo *mount_info) +GDaemonMount * +g_daemon_mount_new (GMountInfo *mount_info) { - GDaemonVolume *volume; + GDaemonMount *mount; - volume = g_object_new (G_TYPE_DAEMON_VOLUME, NULL); - volume->mount_info = g_mount_info_ref (mount_info); + mount = g_object_new (G_TYPE_DAEMON_MOUNT, NULL); + mount->mount_info = g_mount_info_ref (mount_info); - return volume; + return mount; } GMountInfo * -g_daemon_volume_get_mount_info (GDaemonVolume *volume) +g_daemon_mount_get_mount_info (GDaemonMount *mount) { - return volume->mount_info; + return mount->mount_info; } static GFile * -g_daemon_volume_get_root (GVolume *volume) +g_daemon_mount_get_root (GMount *mount) { - GDaemonVolume *daemon_volume = G_DAEMON_VOLUME (volume); + GDaemonMount *daemon_mount = G_DAEMON_MOUNT (mount); - return g_daemon_file_new (daemon_volume->mount_info->mount_spec, "/"); + return g_daemon_file_new (daemon_mount->mount_info->mount_spec, "/"); } static GIcon * -g_daemon_volume_get_icon (GVolume *volume) +g_daemon_mount_get_icon (GMount *mount) { - GDaemonVolume *daemon_volume = G_DAEMON_VOLUME (volume); + GDaemonMount *daemon_mount = G_DAEMON_MOUNT (mount); - return g_themed_icon_new (daemon_volume->mount_info->icon); + return g_themed_icon_new (daemon_mount->mount_info->icon); } static char * -g_daemon_volume_get_name (GVolume *volume) +g_daemon_mount_get_name (GMount *mount) { - GDaemonVolume *daemon_volume = G_DAEMON_VOLUME (volume); + GDaemonMount *daemon_mount = G_DAEMON_MOUNT (mount); - return g_strdup (daemon_volume->mount_info->display_name); + return g_strdup (daemon_mount->mount_info->display_name); } -static GDrive * -g_daemon_volume_get_drive (GVolume *volume) +static GVolume * +g_daemon_mount_get_volume (GMount *mount) { return NULL; } -static gboolean -g_daemon_volume_can_unmount (GVolume *volume) +static GDrive * +g_daemon_mount_get_drive (GMount *mount) { - return TRUE; + return NULL; } static gboolean -g_daemon_volume_can_eject (GVolume *volume) +g_daemon_mount_can_unmount (GMount *mount) { - return FALSE; + return TRUE; } static void @@ -148,17 +148,17 @@ unmount_reply (DBusMessage *reply, } static void -g_daemon_volume_unmount (GVolume *volume, +g_daemon_mount_unmount (GMount *mount, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { - GDaemonVolume *daemon_volume = G_DAEMON_VOLUME (volume); + GDaemonMount *daemon_mount = G_DAEMON_MOUNT (mount); DBusMessage *message; GMountInfo *mount_info; GSimpleAsyncResult *res; - mount_info = daemon_volume->mount_info; + mount_info = daemon_mount->mount_info; message = dbus_message_new_method_call (mount_info->dbus_id, @@ -166,9 +166,9 @@ g_daemon_volume_unmount (GVolume *volume, G_VFS_DBUS_MOUNT_INTERFACE, G_VFS_DBUS_MOUNT_OP_UNMOUNT); - res = g_simple_async_result_new (G_OBJECT (volume), + res = g_simple_async_result_new (G_OBJECT (mount), callback, user_data, - g_daemon_volume_unmount); + g_daemon_mount_unmount); _g_vfs_daemon_call_async (message, unmount_reply, res, @@ -178,7 +178,7 @@ g_daemon_volume_unmount (GVolume *volume, } static gboolean -g_daemon_volume_unmount_finish (GVolume *volume, +g_daemon_mount_unmount_finish (GMount *mount, GAsyncResult *result, GError **error) { @@ -187,14 +187,14 @@ g_daemon_volume_unmount_finish (GVolume *volume, static void -g_daemon_volume_volume_iface_init (GVolumeIface *iface) +g_daemon_mount_mount_iface_init (GMountIface *iface) { - iface->get_root = g_daemon_volume_get_root; - iface->get_name = g_daemon_volume_get_name; - iface->get_icon = g_daemon_volume_get_icon; - iface->get_drive = g_daemon_volume_get_drive; - iface->can_unmount = g_daemon_volume_can_unmount; - iface->can_eject = g_daemon_volume_can_eject; - iface->unmount = g_daemon_volume_unmount; - iface->unmount_finish = g_daemon_volume_unmount_finish; + iface->get_root = g_daemon_mount_get_root; + iface->get_name = g_daemon_mount_get_name; + iface->get_icon = g_daemon_mount_get_icon; + iface->get_volume = g_daemon_mount_get_volume; + iface->get_drive = g_daemon_mount_get_drive; + iface->can_unmount = g_daemon_mount_can_unmount; + iface->unmount = g_daemon_mount_unmount; + iface->unmount_finish = g_daemon_mount_unmount_finish; } diff --git a/client/gdaemonvolume.h b/client/gdaemonmount.h index efec6810..bf121d96 100644 --- a/client/gdaemonvolume.h +++ b/client/gdaemonmount.h @@ -20,35 +20,35 @@ * Author: Alexander Larsson <alexl@redhat.com> */ -#ifndef __G_DAEMON_VOLUME_H__ -#define __G_DAEMON_VOLUME_H__ +#ifndef __G_DAEMON_MOUNT_H__ +#define __G_DAEMON_MOUNT_H__ #include <glib-object.h> -#include <gio/gvolume.h> +#include <gio/gmount.h> #include "gdaemonvfs.h" #include "gdaemonvolumemonitor.h" #include "gmounttracker.h" G_BEGIN_DECLS -#define G_TYPE_DAEMON_VOLUME (g_daemon_volume_get_type ()) -#define G_DAEMON_VOLUME(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DAEMON_VOLUME, GDaemonVolume)) -#define G_DAEMON_VOLUME_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DAEMON_VOLUME, GDaemonVolumeClass)) -#define G_IS_DAEMON_VOLUME(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DAEMON_VOLUME)) -#define G_IS_DAEMON_VOLUME_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DAEMON_VOLUME)) +#define G_TYPE_DAEMON_MOUNT (g_daemon_mount_get_type ()) +#define G_DAEMON_MOUNT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DAEMON_MOUNT, GDaemonMount)) +#define G_DAEMON_MOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_DAEMON_MOUNT, GDaemonMountClass)) +#define G_IS_DAEMON_MOUNT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DAEMON_MOUNT)) +#define G_IS_DAEMON_MOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_DAEMON_MOUNT)) -typedef struct _GDaemonVolumeClass GDaemonVolumeClass; +typedef struct _GDaemonMountClass GDaemonMountClass; -struct _GDaemonVolumeClass { +struct _GDaemonMountClass { GObjectClass parent_class; }; -GType g_daemon_volume_get_type (void) G_GNUC_CONST; +GType g_daemon_mount_get_type (void) G_GNUC_CONST; -GDaemonVolume *g_daemon_volume_new (GMountInfo *mount_info); +GDaemonMount *g_daemon_mount_new (GMountInfo *mount_info); -GMountInfo *g_daemon_volume_get_mount_info (GDaemonVolume *volume); +GMountInfo *g_daemon_mount_get_mount_info (GDaemonMount *mount); G_END_DECLS -#endif /* __G_DAEMON_VOLUME_H__ */ +#endif /* __G_DAEMON_MOUNT_H__ */ diff --git a/client/gdaemonvolumemonitor.c b/client/gdaemonvolumemonitor.c index 70446ac7..bfbfba69 100644 --- a/client/gdaemonvolumemonitor.c +++ b/client/gdaemonvolumemonitor.c @@ -27,68 +27,75 @@ #include <glib.h> #include <glib/gi18n-lib.h> #include "gdaemonvolumemonitor.h" -#include "gdaemonvolume.h" +#include "gdaemonmount.h" #include "gmounttracker.h" struct _GDaemonVolumeMonitor { GVolumeMonitor parent; GMountTracker *mount_tracker; - GList *volumes; + GList *mounts; }; G_DEFINE_DYNAMIC_TYPE (GDaemonVolumeMonitor, g_daemon_volume_monitor, G_TYPE_VOLUME_MONITOR); static GList * -get_mounted_volumes (GVolumeMonitor *volume_monitor) +get_mounts (GVolumeMonitor *volume_monitor) { GDaemonVolumeMonitor *monitor; GList *l; monitor = G_DAEMON_VOLUME_MONITOR (volume_monitor); - l = g_list_copy (monitor->volumes); + l = g_list_copy (monitor->mounts); g_list_foreach (l, (GFunc)g_object_ref, NULL); return l; } static GList * +get_volumes (GVolumeMonitor *volume_monitor) +{ + /* TODO: Can daemon mounts have volumes? */ + return NULL; +} + +static GList * get_connected_drives (GVolumeMonitor *volume_monitor) { /* TODO: Can daemon mounts have drives? */ return NULL; } -static GDaemonVolume * -find_volume_by_mount_info (GDaemonVolumeMonitor *daemon_monitor, GMountInfo *mount_info) +static GDaemonMount * +find_mount_by_mount_info (GDaemonVolumeMonitor *daemon_monitor, GMountInfo *mount_info) { - GDaemonVolume *found_volume = NULL; + GDaemonMount *found_mount = NULL; GList *l; - for (l = daemon_monitor->volumes; l; l = g_list_next (l)) + for (l = daemon_monitor->mounts; l; l = g_list_next (l)) { - GDaemonVolume *existing_volume = l->data; - GMountInfo *existing_mount_info; + GDaemonMount *existing_mount = l->data; + GMountInfo *existing_mount_info; - existing_mount_info = g_daemon_volume_get_mount_info (existing_volume); + existing_mount_info = g_daemon_mount_get_mount_info (existing_mount); if (g_mount_info_equal (mount_info, existing_mount_info)) { - found_volume = existing_volume; + found_mount = existing_mount; break; } } - return found_volume; + return found_mount; } static void mount_added (GDaemonVolumeMonitor *daemon_monitor, GMountInfo *mount_info) { - GDaemonVolume *volume; + GDaemonMount *mount; - volume = find_volume_by_mount_info (daemon_monitor, mount_info); - if (volume) + mount = find_mount_by_mount_info (daemon_monitor, mount_info); + if (mount) { g_warning (G_STRLOC ": Mount was added twice!"); return; @@ -97,34 +104,34 @@ mount_added (GDaemonVolumeMonitor *daemon_monitor, GMountInfo *mount_info) if (mount_info->user_visible) { - volume = g_daemon_volume_new (mount_info); - daemon_monitor->volumes = g_list_prepend (daemon_monitor->volumes, volume); - g_signal_emit_by_name (daemon_monitor, "volume_mounted", volume); + mount = g_daemon_mount_new (mount_info); + daemon_monitor->mounts = g_list_prepend (daemon_monitor->mounts, mount); + g_signal_emit_by_name (daemon_monitor, "mount_added", mount); } } static void mount_removed (GDaemonVolumeMonitor *daemon_monitor, GMountInfo *mount_info) { - GDaemonVolume *volume; + GDaemonMount *mount; - volume = find_volume_by_mount_info (daemon_monitor, mount_info); - if (!volume) + mount = find_mount_by_mount_info (daemon_monitor, mount_info); + if (!mount) { g_warning (G_STRLOC ": An unknown mount was removed!"); return; } - daemon_monitor->volumes = g_list_remove (daemon_monitor->volumes, volume); - g_signal_emit_by_name (daemon_monitor, "volume_unmounted", volume); - g_object_unref (volume); + daemon_monitor->mounts = g_list_remove (daemon_monitor->mounts, mount); + g_signal_emit_by_name (daemon_monitor, "mount_removed", mount); + g_object_unref (mount); } static void g_daemon_volume_monitor_init (GDaemonVolumeMonitor *daemon_monitor) { GList *mounts, *l; - GDaemonVolume *volume; + GDaemonMount *mount; GMountInfo *info; daemon_monitor->mount_tracker = g_mount_tracker_new (_g_daemon_vfs_get_async_bus ()); @@ -141,8 +148,8 @@ g_daemon_volume_monitor_init (GDaemonVolumeMonitor *daemon_monitor) info = l->data; if (info->user_visible) { - volume = g_daemon_volume_new (info); - daemon_monitor->volumes = g_list_prepend (daemon_monitor->volumes, volume); + mount = g_daemon_mount_new (info); + daemon_monitor->mounts = g_list_prepend (daemon_monitor->mounts, mount); } g_mount_info_unref (info); @@ -163,8 +170,8 @@ g_daemon_volume_monitor_finalize (GObject *object) g_object_unref (monitor->mount_tracker); - g_list_foreach (monitor->volumes, (GFunc)g_object_unref, NULL); - g_list_free (monitor->volumes); + g_list_foreach (monitor->mounts, (GFunc)g_object_unref, NULL); + g_list_free (monitor->mounts); if (G_OBJECT_CLASS (g_daemon_volume_monitor_parent_class)->finalize) (*G_OBJECT_CLASS (g_daemon_volume_monitor_parent_class)->finalize) (object); @@ -183,7 +190,8 @@ g_daemon_volume_monitor_class_init (GDaemonVolumeMonitorClass *klass) gobject_class->finalize = g_daemon_volume_monitor_finalize; - monitor_class->get_mounted_volumes = get_mounted_volumes; + monitor_class->get_mounts = get_mounts; + monitor_class->get_volumes = get_volumes; monitor_class->get_connected_drives = get_connected_drives; } diff --git a/client/gdaemonvolumemonitor.h b/client/gdaemonvolumemonitor.h index 4b4b0369..491db1cc 100644 --- a/client/gdaemonvolumemonitor.h +++ b/client/gdaemonvolumemonitor.h @@ -38,6 +38,7 @@ typedef struct _GDaemonVolumeMonitor GDaemonVolumeMonitor; typedef struct _GDaemonVolumeMonitorClass GDaemonVolumeMonitorClass; /* Forward definitions */ +typedef struct _GDaemonMount GDaemonMount; typedef struct _GDaemonVolume GDaemonVolume; typedef struct _GDaemonDrive GDaemonDrive; diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c index 671630a3..bdf7eed2 100644 --- a/client/gvfsfusedaemon.c +++ b/client/gvfsfusedaemon.c @@ -298,15 +298,15 @@ free_file_handle_for_path (const gchar *path) } static MountRecord * -mount_record_new (GVolume *volume) +mount_record_new (GMount *mount) { MountRecord *mount_record; char *name; mount_record = g_new (MountRecord, 1); - mount_record->root = g_volume_get_root (volume); - name = g_volume_get_name (volume); + mount_record->root = g_mount_get_root (mount); + name = g_mount_get_name (mount); /* Keep in sync with gvfs daemon mount tracker */ mount_record->name = g_uri_escape_string (name, "+@#$., ", TRUE); g_free (name); @@ -344,15 +344,15 @@ mount_list_free (void) } static gboolean -mount_record_for_volume_exists (GVolume *volume) +mount_record_for_mount_exists (GMount *mount) { GList *l; GFile *root; gboolean res; - g_assert (volume != NULL); + g_assert (mount != NULL); - root = g_volume_get_root (volume); + root = g_mount_get_root (mount); res = FALSE; @@ -407,26 +407,26 @@ mount_record_find_root_by_mount_name (const gchar *mount_name) static void mount_list_update (void) { - GList *volumes; + GList *mounts; GList *l; - volumes = g_volume_monitor_get_mounted_volumes (volume_monitor); + mounts = g_volume_monitor_get_mounts (volume_monitor); - for (l = volumes; l != NULL; l = l->next) + for (l = mounts; l != NULL; l = l->next) { - GVolume *volume = l->data; + GMount *mount = l->data; - if (!mount_record_for_volume_exists (volume)) + if (!mount_record_for_mount_exists (mount)) { mount_list_lock (); - mount_list = g_list_prepend (mount_list, mount_record_new (volume)); + mount_list = g_list_prepend (mount_list, mount_record_new (mount)); mount_list_unlock (); } - g_object_unref (volume); + g_object_unref (mount); } - g_list_free (volumes); + g_list_free (mounts); } #if 0 @@ -1936,14 +1936,14 @@ vfs_chmod (const gchar *path, mode_t mode) static void mount_tracker_mounted_cb (GVolumeMonitor *volume_monitor, - GVolume *volume) + GMount *mount) { MountRecord *mount_record; - if (mount_record_for_volume_exists (volume)) + if (mount_record_for_mount_exists (mount)) return; - mount_record = mount_record_new (volume); + mount_record = mount_record_new (mount); mount_list_lock (); mount_list = g_list_prepend (mount_list, mount_record); @@ -1952,16 +1952,16 @@ mount_tracker_mounted_cb (GVolumeMonitor *volume_monitor, static void mount_tracker_unmounted_cb (GVolumeMonitor *volume_monitor, - GVolume *volume) + GMount *mount) { GFile *root; GList *l; - root = g_volume_get_root (volume); + root = g_mount_get_root (mount); mount_list_lock (); - root = g_volume_get_root (volume); + root = g_mount_get_root (mount); for (l = mount_list; l != NULL; l = l->next) { @@ -1986,8 +1986,8 @@ subthread_main (gpointer data) mount_list_update (); - g_signal_connect (volume_monitor, "volume_mounted", (GCallback) mount_tracker_mounted_cb, NULL); - g_signal_connect (volume_monitor, "volume_unmounted", (GCallback) mount_tracker_unmounted_cb, NULL); + g_signal_connect (volume_monitor, "mount_added", (GCallback) mount_tracker_mounted_cb, NULL); + g_signal_connect (volume_monitor, "mount_removed", (GCallback) mount_tracker_unmounted_cb, NULL); g_main_loop_run (subthread_main_loop); diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c index 99b85022..706f868b 100644 --- a/daemon/gvfsbackendtrash.c +++ b/daemon/gvfsbackendtrash.c @@ -510,7 +510,7 @@ list_trash_dirs (void) GList *mounts, *l, *li; const char *topdir; char *home_trash; - GUnixMount *mount; + GUnixMountEntry *mount; GList *dirs; GList *topdirs; GList *topdirs_info; |