summaryrefslogtreecommitdiff
path: root/common/gmountoperationdbus.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:27:01 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:27:01 +0000
commit6e653140f5c52d34e1ba189f4c67e5d6ff9f960c (patch)
tree3a5005ccf5837e208a5f45e110b048dce9dccffb /common/gmountoperationdbus.c
parent779e65ac7c102616469a220d31ef69d55ddd2636 (diff)
downloadgvfs-6e653140f5c52d34e1ba189f4c67e5d6ff9f960c.tar.gz
Add g_mount_operation_dbus_fail_at_idle
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1170844391 +0100 svn path=/trunk/; revision=298
Diffstat (limited to 'common/gmountoperationdbus.c')
-rw-r--r--common/gmountoperationdbus.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/common/gmountoperationdbus.c b/common/gmountoperationdbus.c
index 79b689ad..846a8da6 100644
--- a/common/gmountoperationdbus.c
+++ b/common/gmountoperationdbus.c
@@ -398,3 +398,38 @@ mount_op_done (GMountOperationDBus *op,
_g_dbus_oom ();
dbus_message_unref (reply);
}
+
+struct FailData {
+ GMountOperationDBus *op;
+ GError *error;
+};
+
+static void
+fail_data_free (struct FailData *data)
+{
+ g_object_unref (data->op);
+ g_error_free (data->error);
+ g_free (data);
+}
+
+static gboolean
+fail_at_idle (struct FailData *data)
+{
+ g_signal_emit_by_name (data->op, "done", FALSE, data->error);
+ return FALSE;
+}
+
+void
+g_mount_operation_dbus_fail_at_idle (GMountOperationDBus *op,
+ GError *error)
+{
+ struct FailData *data;
+
+ data = g_new (struct FailData, 1);
+ data->op = g_object_ref (op);
+ data->error = g_error_copy (error);
+
+ g_idle_add_full (G_PRIORITY_DEFAULT,
+ (GSourceFunc)fail_at_idle,
+ data, (GDestroyNotify)fail_data_free);
+}