diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/flatpak-dir.c | 4 | ||||
-rw-r--r-- | common/flatpak-utils.c | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 06899dd..d00d313 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -210,6 +210,10 @@ flatpak_dir_get_system_helper (FlatpakDir *self) if (g_once_init_enter (&self->system_helper)) { FlatpakSystemHelper *system_helper; + + /* To ensure reverse mapping */ + flatpak_error_quark (); + system_helper = flatpak_system_helper_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index dfa62c3..18e66cf 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -41,7 +41,22 @@ #include <libsoup/soup.h> /* This is also here so the common code can report these errors to the lib */ -G_DEFINE_QUARK (flatpak-error-quark, flatpak_error) +static const GDBusErrorEntry flatpak_error_entries[] = { + {FLATPAK_ERROR_ALREADY_INSTALLED, "org.freedesktop.Flatpak.Error.AlreadyInstalled"}, + {FLATPAK_ERROR_NOT_INSTALLED, "org.freedesktop.Flatpak.Error.NotInstalled"}, +}; + +GQuark +flatpak_error_quark (void) +{ + static volatile gsize quark_volatile = 0; + + g_dbus_error_register_error_domain ("flatpak-error-quark", + &quark_volatile, + flatpak_error_entries, + G_N_ELEMENTS (flatpak_error_entries)); + return (GQuark) quark_volatile; +} GBytes * flatpak_read_stream (GInputStream *in, |