diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-07-10 17:02:38 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-07-10 17:02:38 +0200 |
commit | 4c4c66fc2d5da54ebb3580da87c37795ffc79253 (patch) | |
tree | f401bfc4d26dc82dfbbd7d267b1b70189af90ec2 /document-portal | |
parent | 929071ad1083494f717f6a5ab6dfcf817d143700 (diff) | |
download | xdg-app-4c4c66fc2d5da54ebb3580da87c37795ffc79253.tar.gz |
Add GetMountPoint method for document portal
This is both to get the mount path and to have a nice way
to activate the mount.
Diffstat (limited to 'document-portal')
-rw-r--r-- | document-portal/xdp-fuse.c | 6 | ||||
-rw-r--r-- | document-portal/xdp-fuse.h | 1 | ||||
-rw-r--r-- | document-portal/xdp-main.c | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/document-portal/xdp-fuse.c b/document-portal/xdp-fuse.c index b6feea6..5d2fd09 100644 --- a/document-portal/xdp-fuse.c +++ b/document-portal/xdp-fuse.c @@ -1724,6 +1724,12 @@ static struct fuse_session *session = NULL; static struct fuse_chan *main_ch = NULL; static char *mount_path = NULL; +const char * +xdp_fuse_get_mountpoint (void) +{ + return mount_path; +} + void xdp_fuse_exit (void) { diff --git a/document-portal/xdp-fuse.h b/document-portal/xdp-fuse.h index f335ccc..f2ef11d 100644 --- a/document-portal/xdp-fuse.h +++ b/document-portal/xdp-fuse.h @@ -9,6 +9,7 @@ G_BEGIN_DECLS gboolean xdp_fuse_init (XdpDocDb *db, GError **error); void xdp_fuse_exit (void); +const char * xdp_fuse_get_mountpoint (void); G_END_DECLS diff --git a/document-portal/xdp-main.c b/document-portal/xdp-main.c index 7cd1ad3..fc250f1 100644 --- a/document-portal/xdp-main.c +++ b/document-portal/xdp-main.c @@ -347,6 +347,13 @@ handle_method (GCallback method_callback, return TRUE; } +static gboolean +handle_get_mount_point (XdpDbusDocuments *object, GDBusMethodInvocation *invocation) +{ + xdp_dbus_documents_complete_get_mount_point (object, invocation, xdp_fuse_get_mountpoint ()); + return TRUE; +} + static void on_bus_acquired (GDBusConnection *connection, const gchar *name, @@ -357,6 +364,7 @@ on_bus_acquired (GDBusConnection *connection, helper = xdp_dbus_documents_skeleton_new (); + g_signal_connect_swapped (helper, "handle-get-mount-point", G_CALLBACK (handle_get_mount_point), NULL); g_signal_connect_swapped (helper, "handle-add", G_CALLBACK (handle_method), portal_add); g_signal_connect_swapped (helper, "handle-add-local", G_CALLBACK (handle_method), portal_add_local); g_signal_connect_swapped (helper, "handle-grant-permissions", G_CALLBACK (handle_method), portal_grant_permissions); |