summaryrefslogtreecommitdiff
path: root/common/flatpak-utils.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-12 22:03:42 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-12 22:03:42 +0200
commit0098164cd6b89e715c734a1a8ac5ad22665feb57 (patch)
tree2f80fbcff1e13306c0eb0f47b3ebdf043062dee5 /common/flatpak-utils.c
parent29390fff3995600b8b776f9d1681e75ab26ba18a (diff)
downloadxdg-app-0098164cd6b89e715c734a1a8ac5ad22665feb57.tar.gz
Register dbus errors for FLATPAK_ERROR
This allows us to transparently pass them from the system helper.
Diffstat (limited to 'common/flatpak-utils.c')
-rw-r--r--common/flatpak-utils.c17
1 files changed, 16 insertions, 1 deletions
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,