Hello community, here is the log from the commit of package gnome-vfs2 checked in at Sat Apr 8 01:59:53 CEST 2006. -------- --- GNOME/gnome-vfs2/gnome-vfs2.changes 2006-04-04 14:22:19.000000000 +0200 +++ gnome-vfs2/gnome-vfs2.changes 2006-04-07 04:42:23.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Apr 7 04:41:58 CEST 2006 - federico@novell.com + +- Updated gnome-vfs2-hal-mount.patch. Now it will correctly call the + user's callbacks to notify them about the status of + mount/unmount/eject operations. Fixes + https://bugzilla.novell.com/show_bug.cgi?id=162702 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-vfs2.spec ++++++ --- /var/tmp/diff_new_pack.AFGxBk/_old 2006-04-08 01:59:41.000000000 +0200 +++ /var/tmp/diff_new_pack.AFGxBk/_new 2006-04-08 01:59:41.000000000 +0200 @@ -19,7 +19,7 @@ Requires: gnome-mime-data Autoreqprov: on Version: 2.12.2 -Release: 42 +Release: 43 Summary: The GNOME 2.x Desktop Virtual File System Libraries URL: http://www.gnome.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -258,6 +258,11 @@ %{prefix}/share/gtk-doc/html/gnome-vfs-2.0 %changelog -n gnome-vfs2 +* Fri Apr 07 2006 - federico@novell.com +- Updated gnome-vfs2-hal-mount.patch. Now it will correctly call the + user's callbacks to notify them about the status of + mount/unmount/eject operations. Fixes + https://bugzilla.novell.com/show_bug.cgi?id=162702 * Tue Apr 04 2006 - sbrabec@suse.cz - Changed default FTP handler to firefox (#163193). * Thu Mar 30 2006 - gekker@suse.de ++++++ gnome-vfs2-hal-mount.patch ++++++ --- /var/tmp/diff_new_pack.AFGxBk/_old 2006-04-08 01:59:42.000000000 +0200 +++ /var/tmp/diff_new_pack.AFGxBk/_new 2006-04-08 01:59:42.000000000 +0200 @@ -56,7 +56,7 @@ #ifdef USE_VOLRMMOUNT static const char *volrmmount_locations [] = { -@@ -58,7 +56,11 @@ +@@ -58,7 +56,11 @@ static const char *volrmmount_locations #define UMOUNT_COMMAND volrmmount_locations #define UMOUNT_SEPARATOR " -e " @@ -69,7 +69,7 @@ static const char *mount_known_locations [] = { "/sbin/mount", "/bin/mount", -@@ -80,28 +82,23 @@ +@@ -80,28 +82,23 @@ static const char *umount_known_location #endif /* USE_VOLRMMOUNT */ @@ -108,7 +108,7 @@ GnomeVFSVolumeOpCallback callback; gpointer user_data; -@@ -214,7 +211,6 @@ +@@ -214,7 +211,6 @@ report_mount_result (gpointer callback_d } g_free (info->mount_point); g_free (info->device_path); @@ -116,7 +116,7 @@ g_free (info->error_message); g_free (info->detailed_error_message); g_free (info); -@@ -240,27 +236,20 @@ +@@ -240,27 +236,20 @@ mount_unmount_thread (void *arg) info->error_message = NULL; info->detailed_error_message = NULL; @@ -153,7 +153,7 @@ info->error_message = generate_mount_error_message (standard_error, info->device_type); } else { -@@ -293,36 +282,21 @@ +@@ -293,36 +282,21 @@ mount_unmount_thread (void *arg) } } @@ -201,16 +201,60 @@ error = NULL; if (g_spawn_sync (NULL, argv, -@@ -368,7 +342,7 @@ +@@ -368,7 +342,51 @@ mount_unmount_thread (void *arg) return NULL; } -#endif /* !G_OS_WIN32 */ +#endif /* !USE_HAL && !G_OS_WIN32 */ ++ ++struct dispatch_callback_closure { ++ gboolean succeeded; ++ char *error_message; ++ char *detailed_error_message; ++ GnomeVFSVolumeOpCallback callback; ++ gpointer user_data; ++}; ++ ++static gboolean ++dispatch_callback_idle_cb (gpointer data) ++{ ++ struct dispatch_callback_closure *closure; ++ ++ closure = data; ++ ++ (* closure->callback) (closure->succeeded, ++ closure->error_message, ++ closure->detailed_error_message, ++ closure->user_data); ++ g_free (closure->error_message); ++ g_free (closure->detailed_error_message); ++ g_free (closure); ++ return FALSE; ++} ++ ++static void ++queue_dispatch_callback (gboolean succeeded, ++ const char *error_message, ++ const char *detailed_error_message, ++ GnomeVFSVolumeOpCallback callback, ++ gpointer user_data) ++{ ++ struct dispatch_callback_closure *closure; ++ ++ closure = g_new (struct dispatch_callback_closure, 1); ++ closure->succeeded = succeeded; ++ closure->error_message = g_strdup (error_message); ++ closure->detailed_error_message = g_strdup (detailed_error_message); ++ closure->callback = callback; ++ closure->user_data = user_data; ++ ++ g_idle_add (dispatch_callback_idle_cb, closure); ++} static void mount_unmount_operation (const char *mount_point, -@@ -376,20 +350,86 @@ +@@ -376,20 +394,92 @@ mount_unmount_operation (const char *mou const char *hal_udi, const char *filesystem_type, GnomeVFSDeviceType device_type, @@ -230,6 +274,7 @@ + dbus_error_init (&error); + + if (!dbus_ctx && !(dbus_ctx = dbus_bus_get (DBUS_BUS_SYSTEM, &error))) { ++ queue_dispatch_callback (FALSE, _("Could not get a DBus connection"), error.message, callback, user_data); + g_warning ("cannot get a DBus connection: %s", error.message); + goto exception; + } @@ -244,6 +289,7 @@ + if (!(dmesg = dbus_message_new_method_call ("org.freedesktop.Hal", hal_udi, + "org.freedesktop.Hal.Device.Volume", + method))) { ++ queue_dispatch_callback (FALSE, _("Could not create dbus message"), method, callback, user_data); + g_warning ("%s failed for %s: could not create dbus message", method, hal_udi); + return; + } @@ -255,6 +301,7 @@ + + if (!dbus_message_append_args (dmesg, DBUS_TYPE_STRING, &mount_point, DBUS_TYPE_STRING, &fstype, + DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &options, 0, DBUS_TYPE_INVALID)) { ++ queue_dispatch_callback (FALSE, _("Could not append args to dbus message"), method, callback, user_data); + g_warning ("Mount failed for %s: could not append args to dbus message", hal_udi); + dbus_message_unref (dmesg); + goto exception; @@ -265,6 +312,7 @@ + char *options[] = { NULL }; + + if (!dbus_message_append_args (dmesg, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &options, 0, DBUS_TYPE_INVALID)) { ++ queue_dispatch_callback (FALSE, _("Could not append args args to dbus message"), method, callback, user_data); + g_warning ("Unmount failed for %s: could not append args to dbus message", hal_udi); + dbus_message_unref (dmesg); + goto exception; @@ -272,23 +320,25 @@ + } + + if (!(reply = dbus_connection_send_with_reply_and_block (dbus_ctx, dmesg, -1, &error))) { ++ queue_dispatch_callback (FALSE, _("Operation failed"), error.message, callback, user_data); + g_warning ("%s failed for %s: %s", method, hal_udi, error.message); + dbus_message_unref (dmesg); + goto exception; ++ } else { ++ queue_dispatch_callback (TRUE, NULL, NULL, callback, user_data); + } -+ ++ + dbus_message_unref (dmesg); + dbus_message_unref (reply); -+ ++ + /* Note: we can't call @callback with success because the method is + * async; device adds/removes will be picked up by the daemon + * instead */ -+ ++ + return; -+ ++ + exception: -+ -+ /*callback (FALSE, error.message, error.message, user_data);*/ ++ + dbus_error_free (&error); + +#elif !defined (G_OS_WIN32) @@ -302,7 +352,7 @@ #ifdef USE_VOLRMMOUNT name = strrchr (mount_point, '/'); -@@ -399,52 +439,21 @@ +@@ -399,52 +489,21 @@ mount_unmount_operation (const char *mou name = mount_point; } #else @@ -365,7 +415,7 @@ if (command) { i = 0; mount_info->argv[i++] = g_strdup (command); -@@ -458,10 +467,7 @@ +@@ -458,10 +517,7 @@ mount_unmount_operation (const char *mou mount_info->mount_point = g_strdup (mount_point); mount_info->device_path = g_strdup (device_path); mount_info->device_type = device_type; @@ -377,7 +427,7 @@ mount_info->callback = callback; mount_info->user_data = user_data; -@@ -620,7 +626,7 @@ +@@ -620,7 +676,7 @@ gnome_vfs_volume_unmount (GnomeVFSVolume gnome_vfs_volume_get_hal_udi (volume), filesystem_type, gnome_vfs_volume_get_device_type (volume), @@ -386,7 +436,7 @@ callback, user_data); g_free (mount_path); g_free (device_path); -@@ -662,7 +668,7 @@ +@@ -662,7 +718,7 @@ gnome_vfs_volume_eject (GnomeVFSVolume * gnome_vfs_volume_get_hal_udi (volume), NULL, gnome_vfs_volume_get_device_type (volume), @@ -395,7 +445,7 @@ callback, user_data); g_free (mount_path); g_free (device_path); -@@ -697,7 +703,7 @@ +@@ -697,7 +753,7 @@ gnome_vfs_drive_mount (GnomeVFSDrive *d gnome_vfs_drive_get_hal_udi (drive), NULL, GNOME_VFS_DEVICE_TYPE_UNKNOWN, @@ -404,7 +454,7 @@ callback, user_data); g_free (mount_path); g_free (device_path); -@@ -791,7 +797,7 @@ +@@ -791,7 +847,7 @@ gnome_vfs_drive_eject (GnomeVFSDrive *d gnome_vfs_drive_get_hal_udi (drive), NULL, GNOME_VFS_DEVICE_TYPE_UNKNOWN, ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...