diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-01-21 10:49:58 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-01-21 10:49:58 +0000 |
commit | bd5de03ac4823797587048441d57fdd7a787f4b9 (patch) | |
tree | 249e49ddabbdf32a747b49b3afdf8edb501b65e1 | |
parent | ddc89cecf2ea4786409733140a50794795ebc797 (diff) | |
download | gvfs-bd5de03ac4823797587048441d57fdd7a787f4b9.tar.gz |
Do the initial mount tracker call sync so that the volume monitor is
2008-01-21 Alexander Larsson <alexl@redhat.com>
* common/gmounttracker.c:
Do the initial mount tracker call sync so that
the volume monitor is populated with the current
status after construction. This is more in-line
with what apps expect.
svn path=/trunk/; revision=1153
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | common/gmounttracker.c | 29 |
2 files changed, 17 insertions, 20 deletions
@@ -1,3 +1,11 @@ +2008-01-21 Alexander Larsson <alexl@redhat.com> + + * common/gmounttracker.c: + Do the initial mount tracker call sync so that + the volume monitor is populated with the current + status after construction. This is more in-line + with what apps expect. + 2008-01-18 Alexander Larsson <alexl@redhat.com> * common/gmountspec.c: diff --git a/common/gmounttracker.c b/common/gmounttracker.c index aad00aba..3bbc7e03 100644 --- a/common/gmounttracker.c +++ b/common/gmounttracker.c @@ -373,18 +373,13 @@ g_mount_tracker_remove_mount (GMountTracker *tracker, } static void -list_mounts_reply (DBusPendingCall *pending, - void *_data) +list_mounts_reply (GMountTracker *tracker, + DBusMessage *reply) { - GMountTracker *tracker = _data; DBusMessageIter iter, array_iter; GMountInfo *info; - DBusMessage *reply; gboolean b; - reply = dbus_pending_call_steal_reply (pending); - dbus_pending_call_unref (pending); - b = dbus_message_iter_init (reply, &iter); if (b && dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) { @@ -405,8 +400,6 @@ list_mounts_reply (DBusPendingCall *pending, { /* list_mounts_reply problem - gvfsd not running? */ } - - dbus_message_unref (reply); } static DBusHandlerResult @@ -452,7 +445,7 @@ g_mount_tracker_filter_func (DBusConnection *conn, static void init_connection (GMountTracker *tracker) { - DBusMessage *message; + DBusMessage *message, *reply; DBusPendingCall *pending; if (tracker->connection == NULL) @@ -468,19 +461,15 @@ init_connection (GMountTracker *tracker) dbus_message_set_auto_start (message, TRUE); - if (!dbus_connection_send_with_reply (tracker->connection, message, - &pending, - G_VFS_DBUS_TIMEOUT_MSECS)) - _g_dbus_oom (); - + reply = dbus_connection_send_with_reply_and_block (tracker->connection, message, + G_VFS_DBUS_TIMEOUT_MSECS, + NULL); dbus_message_unref (message); - if (pending != NULL) + if (reply != NULL) { - if (!dbus_pending_call_set_notify (pending, - list_mounts_reply, - g_object_ref (tracker), g_object_unref)) - _g_dbus_oom (); + list_mounts_reply (tracker, reply); + dbus_message_unref (reply); } dbus_connection_add_filter (tracker->connection, g_mount_tracker_filter_func, tracker, NULL); |