summaryrefslogtreecommitdiff
path: root/daemon/gvfsjobmountmountable.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-01-09 14:49:05 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-01-09 14:49:05 +0000
commit23730c607ca8ae5a6f8d84d623e7b21bdd5bd1c3 (patch)
tree1f4c6e149a351d32ba92a9ba71c6856ce771d81e /daemon/gvfsjobmountmountable.c
parentca250f832f62324f0bef8fab968d681d03a84a57 (diff)
downloadgvfs-23730c607ca8ae5a6f8d84d623e7b21bdd5bd1c3.tar.gz
Add g_mount_source_get_operation() that lets you handle a remote
2008-01-09 Alexander Larsson <alexl@redhat.com> * common/gmountsource.[ch]: Add g_mount_source_get_operation() that lets you handle a remote GMountSource as if it was a GMountOperation. * common/gmountoperationdbus.c: * programs/gvfs-mount.c: Update to new GMountOperation APIs * client/gdaemonfile.c: * daemon/gvfsjobmountmountable.[ch]: Also let you return target by uri, as not all targets are from gvfs. * daemon/gvfsbackendcomputer.c: Initial cut at mount_mountable svn path=/trunk/; revision=1085
Diffstat (limited to 'daemon/gvfsjobmountmountable.c')
-rw-r--r--daemon/gvfsjobmountmountable.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/daemon/gvfsjobmountmountable.c b/daemon/gvfsjobmountmountable.c
index 1af2823d..a83c04a3 100644
--- a/daemon/gvfsjobmountmountable.c
+++ b/daemon/gvfsjobmountmountable.c
@@ -135,6 +135,15 @@ g_vfs_job_mount_mountable_set_target (GVfsJobMountMountable *job,
job->must_mount_location = must_mount_location;
}
+void
+g_vfs_job_mount_mountable_set_target_uri (GVfsJobMountMountable *job,
+ const char *uri,
+ gboolean must_mount_location)
+{
+ job->target_uri = g_strdup (uri);
+ job->must_mount_location = must_mount_location;
+}
+
static void
run (GVfsJob *job)
{
@@ -178,17 +187,30 @@ create_reply (GVfsJob *job,
GVfsJobMountMountable *op_job = G_VFS_JOB_MOUNT_MOUNTABLE (job);
DBusMessage *reply;
DBusMessageIter iter;
- dbus_bool_t must_mount;
+ dbus_bool_t must_mount, is_uri;
reply = dbus_message_new_method_return (message);
- dbus_message_iter_init_append (reply, &iter);
- g_mount_spec_to_dbus (&iter, op_job->mount_spec);
must_mount = op_job->must_mount_location;
- _g_dbus_message_append_args (reply,
- G_DBUS_TYPE_CSTRING, &op_job->target_filename,
- DBUS_TYPE_BOOLEAN, &must_mount,
- 0);
+ is_uri = op_job->target_uri != NULL;
+ if (is_uri)
+ {
+ _g_dbus_message_append_args (reply,
+ DBUS_TYPE_BOOLEAN, &is_uri,
+ G_DBUS_TYPE_CSTRING, &op_job->target_uri,
+ DBUS_TYPE_BOOLEAN, &must_mount,
+ 0);
+ }
+ else
+ {
+ _g_dbus_message_append_args (reply,
+ DBUS_TYPE_BOOLEAN, &is_uri,
+ G_DBUS_TYPE_CSTRING, &op_job->target_filename,
+ DBUS_TYPE_BOOLEAN, &must_mount,
+ 0);
+ dbus_message_iter_init_append (reply, &iter);
+ g_mount_spec_to_dbus (&iter, op_job->mount_spec);
+ }
return reply;
}