From ad0aa467d0474d1e2777a5b06752bb1dc27744d9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 16 May 2023 12:52:23 +0100 Subject: [PATCH] common: Don't depend on generated D-Bus code in utils module Each of these is only needed in one place, so move them there. This is another step towards the utils module being the lowest-level. Signed-off-by: Simon McVittie --- common/flatpak-run.c | 7 +++++++ common/flatpak-utils-private.h | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/common/flatpak-run.c b/common/flatpak-run.c index 287453d2..fec87770 100644 --- a/common/flatpak-run.c +++ b/common/flatpak-run.c @@ -53,6 +53,7 @@ #include #include "libglnx.h" +#include "flatpak-dbus-generated.h" #include "flatpak-run-dbus-private.h" #include "flatpak-run-private.h" #include "flatpak-run-sockets-private.h" @@ -66,6 +67,12 @@ #define DEFAULT_SHELL "/bin/sh" +typedef FlatpakSessionHelper AutoFlatpakSessionHelper; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoFlatpakSessionHelper, g_object_unref) + +typedef XdpDbusDocuments AutoXdpDbusDocuments; +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoXdpDbusDocuments, g_object_unref) + static int flatpak_extension_compare_by_path (gconstpointer _a, gconstpointer _b) diff --git a/common/flatpak-utils-private.h b/common/flatpak-utils-private.h index 82653880..5d32b650 100644 --- a/common/flatpak-utils-private.h +++ b/common/flatpak-utils-private.h @@ -26,8 +26,6 @@ #include "libglnx.h" #include #include -#include "flatpak-dbus-generated.h" -#include "flatpak-document-dbus-generated.h" #include "flatpak-error.h" #include "flatpak-glib-backports-private.h" #include "flatpak-variant-private.h" @@ -556,14 +554,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRepoTransaction, flatpak_repo_transaction_ #define AUTOLOCK(name) G_GNUC_UNUSED __attribute__((cleanup (flatpak_auto_unlock_helper))) GMutex * G_PASTE (auto_unlock, __LINE__) = flatpak_auto_lock_helper (&G_LOCK_NAME (name)) -/* This uses a weird Auto prefix to avoid conflicts with later added autogenerated autoptr support, per: - * https://git.gnome.org/browse/glib/commit/?id=1c6cd5f0a3104aa9b62c7f1d3086181f63e71b59 - */ -typedef FlatpakSessionHelper AutoFlatpakSessionHelper; -G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoFlatpakSessionHelper, g_object_unref) -typedef XdpDbusDocuments AutoXdpDbusDocuments; -G_DEFINE_AUTOPTR_CLEANUP_FUNC (AutoXdpDbusDocuments, g_object_unref) - typedef struct FlatpakXml FlatpakXml; struct FlatpakXml