diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-08-26 17:26:53 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-08-26 17:26:53 +0200 |
commit | 0c253766576e072418baf4eaf7e89d8d5cfec992 (patch) | |
tree | bef45f1b707c856b3f54398c50b683295569aafa /document-portal | |
parent | 12fbd9ff95482357b8285f97c2c28bd290add993 (diff) | |
download | xdg-app-0c253766576e072418baf4eaf7e89d8d5cfec992.tar.gz |
Switch document portal to use strings for document ids
Diffstat (limited to 'document-portal')
-rw-r--r-- | document-portal/xdp-main.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/document-portal/xdp-main.c b/document-portal/xdp-main.c index e529c71..e3a2e29 100644 --- a/document-portal/xdp-main.c +++ b/document-portal/xdp-main.c @@ -104,15 +104,13 @@ portal_grant_permissions (GDBusMethodInvocation *invocation, const char *app_id) { const char *target_app_id; - guint32 doc_id; - g_autofree char *id = NULL; + const char *id; g_autoptr(GError) error = NULL; g_autofree const char **permissions = NULL; XdpPermissionFlags perms; g_autoptr(XdgAppDbEntry) entry = NULL; - g_variant_get (parameters, "(u&s^a&s)", &doc_id, &target_app_id, &permissions); - id = xdp_name_from_id (doc_id); + g_variant_get (parameters, "(&s&s^a&s)", &id, &target_app_id, &permissions); entry = xdg_app_db_lookup (db, id); if (entry == NULL) @@ -152,14 +150,12 @@ portal_revoke_permissions (GDBusMethodInvocation *invocation, { const char *target_app_id; g_autoptr(GError) error = NULL; - g_autofree char *id = NULL; - guint32 doc_id; + const char *id; g_autofree const char **permissions = NULL; g_autoptr(XdgAppDbEntry) entry = NULL; XdpPermissionFlags perms; - g_variant_get (parameters, "(u&s^a&s)", &doc_id, &target_app_id, &permissions); - id = xdp_name_from_id (doc_id); + g_variant_get (parameters, "(&s&s^a&s)", &id, &target_app_id, &permissions); entry = xdg_app_db_lookup (db, id); if (entry == NULL) @@ -198,18 +194,16 @@ portal_delete (GDBusMethodInvocation *invocation, GVariant *parameters, const char *app_id) { - guint32 doc_id; - g_autofree char *id = NULL; + const char *id; g_autoptr(XdgAppDbEntry) entry = NULL; - g_variant_get (parameters, "(u)", &doc_id); - id = xdp_name_from_id (doc_id); + g_variant_get (parameters, "(s)", &id); entry = xdg_app_db_lookup (db, id); if (entry == NULL) { g_dbus_method_invocation_return_error (invocation, XDG_APP_ERROR, XDG_APP_ERROR_NOT_FOUND, - "No such document: %d", doc_id); + "No such document: %s", id); return; } @@ -291,7 +285,7 @@ portal_add (GDBusMethodInvocation *invocation, id = do_create_doc (uri); g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(u)", xdp_id_from_name (id))); + g_variant_new ("(s)", id)); } static void @@ -376,7 +370,7 @@ portal_add_local (GDBusMethodInvocation *invocation, } g_dbus_method_invocation_return_value (invocation, - g_variant_new ("(u)", xdp_id_from_name (id))); + g_variant_new ("(s)", id)); } typedef void (*PortalMethod) (GDBusMethodInvocation *invocation, |