diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-05-12 16:43:16 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-05-12 16:43:16 +0200 |
commit | 2ef6d9d5d999a5e3a6b970c8a4a68b52daf987f4 (patch) | |
tree | dcf0d3c0932d64edca21044e293e5a756d7920cc | |
parent | e23bc2b7a6d7e4fe609f24762c5d48fc60ba42f4 (diff) | |
download | xdg-app-2ef6d9d5d999a5e3a6b970c8a4a68b52daf987f4.tar.gz |
common: Remove FlatpakDirError in favour of FlatpakError from the lib
-rw-r--r-- | common/flatpak-dir.c | 20 | ||||
-rw-r--r-- | common/flatpak-dir.h | 8 | ||||
-rw-r--r-- | common/flatpak-utils.c | 2 |
3 files changed, 10 insertions, 20 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index db9328d..7dbd93c 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -80,8 +80,6 @@ typedef struct G_DEFINE_TYPE (FlatpakDir, flatpak_dir, G_TYPE_OBJECT) G_DEFINE_TYPE (FlatpakDeploy, flatpak_deploy, G_TYPE_OBJECT) -G_DEFINE_QUARK (flatpak-dir-error-quark, flatpak_dir_error) - enum { PROP_0, @@ -489,7 +487,7 @@ flatpak_dir_load_deployed (FlatpakDir *self, deploy_dir = flatpak_dir_get_if_deployed (self, ref, checksum, cancellable); if (deploy_dir == NULL) { - g_set_error (error, FLATPAK_DIR_ERROR, FLATPAK_DIR_ERROR_NOT_DEPLOYED, "%s not installed", ref); + g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED, "%s not installed", ref); return NULL; } @@ -2538,9 +2536,9 @@ flatpak_dir_deploy (FlatpakDir *self, real_checkoutdir = g_file_get_child (deploy_base, checksum); if (g_file_query_exists (real_checkoutdir, cancellable)) { - g_set_error (error, FLATPAK_DIR_ERROR, - FLATPAK_DIR_ERROR_ALREADY_DEPLOYED, - "%s branch %s already deployed", ref, checksum); + g_set_error (error, FLATPAK_ERROR, + FLATPAK_ERROR_ALREADY_INSTALLED, + "%s branch %s already installed", ref, checksum); return FALSE; } @@ -2831,8 +2829,8 @@ flatpak_dir_deploy_update (FlatpakDir *self, old_deploy_data, cancellable, &my_error)) { - if (g_error_matches (my_error, FLATPAK_DIR_ERROR, - FLATPAK_DIR_ERROR_ALREADY_DEPLOYED)) + if (g_error_matches (my_error, FLATPAK_ERROR, + FLATPAK_ERROR_ALREADY_INSTALLED)) return TRUE; g_propagate_error (error, my_error); @@ -3271,9 +3269,9 @@ flatpak_dir_undeploy (FlatpakDir *self, checkoutdir = g_file_get_child (deploy_base, checksum); if (!g_file_query_exists (checkoutdir, cancellable)) { - g_set_error (error, FLATPAK_DIR_ERROR, - FLATPAK_DIR_ERROR_ALREADY_UNDEPLOYED, - "%s branch %s already undeployed", ref, checksum); + g_set_error (error, FLATPAK_ERROR, + FLATPAK_ERROR_NOT_INSTALLED, + "%s branch %s not installed", ref, checksum); goto out; } diff --git a/common/flatpak-dir.h b/common/flatpak-dir.h index 7f76e2d..533558c 100644 --- a/common/flatpak-dir.h +++ b/common/flatpak-dir.h @@ -40,14 +40,6 @@ GType flatpak_deploy_get_type (void); G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakDir, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakDeploy, g_object_unref) -#define FLATPAK_DIR_ERROR flatpak_dir_error_quark () - -typedef enum { - FLATPAK_DIR_ERROR_ALREADY_DEPLOYED, - FLATPAK_DIR_ERROR_ALREADY_UNDEPLOYED, - FLATPAK_DIR_ERROR_NOT_DEPLOYED, -} FlatpakDirErrorEnum; - typedef enum { FLATPAK_HELPER_DEPLOY_FLAGS_NONE = 0, FLATPAK_HELPER_DEPLOY_FLAGS_UPDATE = 1 << 0, diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index f20b9e3..dfa62c3 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -650,7 +650,7 @@ flatpak_find_deploy_for_ref (const char *ref, system_dir = flatpak_dir_get_system (); deploy = flatpak_dir_load_deployed (user_dir, ref, NULL, cancellable, &my_error); - if (deploy == NULL && g_error_matches (my_error, FLATPAK_DIR_ERROR, FLATPAK_DIR_ERROR_NOT_DEPLOYED)) + if (deploy == NULL && g_error_matches (my_error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED)) { g_clear_error (&my_error); deploy = flatpak_dir_load_deployed (system_dir, ref, NULL, cancellable, &my_error); |