summaryrefslogtreecommitdiff
path: root/system-helper
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-09 08:40:45 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-09 08:41:12 +0200
commitce20be26f80dbb9769e8b758b3483edc827e7aaa (patch)
treeda7cc2a6337cee088b1849508f7b896cfffcbb52 /system-helper
parent23dbfd530185a650325d527a6c8ca3700094cab2 (diff)
downloadxdg-app-ce20be26f80dbb9769e8b758b3483edc827e7aaa.tar.gz
system-helper: Work around upstream polkit adding autoptr support
This fixes issues reported in https://bugs.freedesktop.org/show_bug.cgi?id=95065
Diffstat (limited to 'system-helper')
-rw-r--r--system-helper/xdg-app-system-helper.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/system-helper/xdg-app-system-helper.c b/system-helper/xdg-app-system-helper.c
index cd3254d..cf46911 100644
--- a/system-helper/xdg-app-system-helper.c
+++ b/system-helper/xdg-app-system-helper.c
@@ -32,11 +32,15 @@
static PolkitAuthority *authority = NULL;
-#ifndef glib_autoptr_cleanup_PolkitAuthorizationResult
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitDetails, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
-#endif
+/* This uses a weird Auto prefix to avoid conflicts with later added polkit types.
+ */
+typedef PolkitAuthorizationResult AutoPolkitAuthorizationResult;
+typedef PolkitDetails AutoPolkitDetails;
+typedef PolkitSubject AutoPolkitSubject;
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoPolkitAuthorizationResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoPolkitDetails, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoPolkitSubject, g_object_unref)
static gboolean
handle_deploy (XdgAppSystemHelper *object,
@@ -51,8 +55,8 @@ handle_deploy (XdgAppSystemHelper *object,
g_autoptr(GFile) path = g_file_new_for_path (arg_repo_path);
g_autoptr(GError) error = NULL;
g_autoptr(GFile) deploy_dir = NULL;
- g_autoptr(PolkitSubject) subject = NULL;
- g_autoptr(PolkitDetails) details = NULL;
+ g_autoptr(AutoPolkitSubject) subject = NULL;
+ g_autoptr(AutoPolkitDetails) details = NULL;
gboolean is_update;
g_autoptr(GMainContext) main_context = NULL;
@@ -168,10 +172,10 @@ xdg_app_authorize_method_handler (GDBusInterfaceSkeleton *interface,
const gchar *sender;
const gchar *action;
- g_autoptr(PolkitSubject) subject = NULL;
- g_autoptr(PolkitDetails) details = NULL;
+ g_autoptr(AutoPolkitSubject) subject = NULL;
+ g_autoptr(AutoPolkitDetails) details = NULL;
g_autoptr(GError) error = NULL;
- g_autoptr(PolkitAuthorizationResult) result = NULL;
+ g_autoptr(AutoPolkitAuthorizationResult) result = NULL;
authorized = FALSE;