From fe0a1be5f811525ae135588395ec08f87c268555 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 12 May 2016 19:52:48 +0200 Subject: common: Add flags for flatpak_dir_uninstall This is better than a list of booleans. --- app/flatpak-builtins-uninstall.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'app') 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; -- cgit v1.2.1