summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-file-operations.c
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2012-03-05 11:53:52 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2012-03-05 12:00:58 -0500
commit819a5d14a33d95ba5ef25a3becec4ebccb93807b (patch)
treea80c8b88109957eba9937d4decfb4b30fb99a9f0 /libnautilus-private/nautilus-file-operations.c
parent503443418709c9fb42af52c90c035b3957b0686e (diff)
downloadnautilus-819a5d14a33d95ba5ef25a3becec4ebccb93807b.tar.gz
file-operations: use the right prototype for empty trash callback
When unmounting, we might first prompt whether the trash should be emptied or not on the target volume. If we do so, make sure the callback from the empty trash job has the right prototype, to avoid crashing later trying to interpret a gboolean as a pointer to a data structure. https://bugzilla.gnome.org/show_bug.cgi?id=670595
Diffstat (limited to 'libnautilus-private/nautilus-file-operations.c')
-rw-r--r--libnautilus-private/nautilus-file-operations.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 5cb83cbd6..3d4774d4b 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -2229,6 +2229,14 @@ prompt_empty_trash (GtkWindow *parent_window)
return result;
}
+static void
+empty_trash_for_unmount_done (gboolean success,
+ gpointer user_data)
+{
+ UnmountData *data = user_data;
+ do_unmount (data);
+}
+
void
nautilus_file_operations_unmount_mount_full (GtkWindow *parent_window,
GMount *mount,
@@ -2260,7 +2268,7 @@ nautilus_file_operations_unmount_mount_full (GtkWindow *par
job = op_job_new (EmptyTrashJob, parent_window);
job->should_confirm = FALSE;
job->trash_dirs = get_trash_dirs_for_mount (mount);
- job->done_callback = (NautilusOpCallback)do_unmount;
+ job->done_callback = empty_trash_for_unmount_done;
job->done_callback_data = data;
g_io_scheduler_push_job (empty_trash_job,
job,