Skip to content

Commit

Permalink
common: Don't depend on generated D-Bus code in utils module
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
smcv committed May 3, 2024
1 parent a01371c commit ad0aa46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 7 additions & 0 deletions common/flatpak-run.c
Expand Up @@ -53,6 +53,7 @@
#include <gio/gio.h>
#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"
Expand All @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions common/flatpak-utils-private.h
Expand Up @@ -26,8 +26,6 @@
#include "libglnx.h"
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ad0aa46

Please sign in to comment.