[nautilus] file-operations: use the right prototype for empty trash callback
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file-operations: use the right prototype for empty trash callback
- Date: Mon, 5 Mar 2012 17:05:30 +0000 (UTC)
commit 819a5d14a33d95ba5ef25a3becec4ebccb93807b
Author: Michael Terry <michael terry canonical com>
Date: Mon Mar 5 11:53:52 2012 -0500
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
libnautilus-private/nautilus-file-operations.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 5cb83cb..3d4774d 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]