summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-12 19:52:48 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-12 19:52:48 +0200
commitfe0a1be5f811525ae135588395ec08f87c268555 (patch)
treec714b8e9102289658102675b054bb6c6d20e890a /app
parent9d6bc9964988842aea8226a3d3320da452bb58ea (diff)
downloadxdg-app-fe0a1be5f811525ae135588395ec08f87c268555.tar.gz
common: Add flags for flatpak_dir_uninstall
This is better than a list of booleans.
Diffstat (limited to 'app')
-rw-r--r--app/flatpak-builtins-uninstall.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/flatpak-builtins-uninstall.c b/app/flatpak-builtins-uninstall.c
index 4504954..1091e20 100644
--- a/app/flatpak-builtins-uninstall.c
+++ b/app/flatpak-builtins-uninstall.c
@@ -55,6 +55,7 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
const char *branch = NULL;
g_autofree char *ref = NULL;
gboolean is_app;
+ FlatpakHelperUninstallFlags flags = 0;
context = g_option_context_new ("APP [BRANCH] - Uninstall an application");
@@ -82,12 +83,13 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
/* TODO: when removing runtimes, look for apps that use it, require --force */
- if (!flatpak_dir_uninstall (dir,
- ref,
- opt_keep_ref,
- opt_force_remove,
- cancellable,
- error))
+ if (opt_keep_ref)
+ flags |= FLATPAK_HELPER_UNINSTALL_FLAGS_KEEP_REF;
+ if (opt_force_remove)
+ flags |= FLATPAK_HELPER_UNINSTALL_FLAGS_FORCE_REMOVE;
+
+ if (!flatpak_dir_uninstall (dir, ref, flags,
+ cancellable, error))
return FALSE;
return TRUE;