summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-01-31 15:30:29 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2019-02-01 16:30:17 +0000
commitd5e29707253b650e28576217f53bbe9230d89173 (patch)
treeee84ab01c0099ba28e6c638207036d794162479c
parent5a08abb3992c103aac620937be36070f34ff667d (diff)
downloadflatpak-d5e29707253b650e28576217f53bbe9230d89173.tar.gz
cli transaction: Adapt to an api change
In f7a566e2ab2f51d8e3, the flatpak_installation_get_display_name() api was changed to (almost) always return a non-NULL string. Adapt to this change, in order to use the preferred messages here. Closes: #2655 Closes: #2668 Approved by: alexlarsson
-rw-r--r--app/flatpak-cli-transaction.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c
index eb19dcab..16d2a9a6 100644
--- a/app/flatpak-cli-transaction.c
+++ b/app/flatpak-cli-transaction.c
@@ -951,20 +951,21 @@ transaction_ready (FlatpakTransaction *transaction)
{
FlatpakInstallation *installation = flatpak_transaction_get_installation (transaction);
const char *name;
+ const char *id;
gboolean ret;
g_print ("\n");
name = flatpak_installation_get_display_name (installation);
- if (name == NULL)
- name = flatpak_installation_get_id (installation);
+ id = flatpak_installation_get_id (installation);
- if (name != NULL)
- ret = flatpak_yes_no_prompt (TRUE, _("Proceed with these changes to the %s installation?"), name);
- else if (flatpak_installation_get_is_user (installation))
+ if (flatpak_installation_get_is_user (installation))
ret = flatpak_yes_no_prompt (TRUE, _("Proceed with these changes to the user installation?"));
- else
+ else if (g_strcmp0 (id, "default") == 0)
ret = flatpak_yes_no_prompt (TRUE, _("Proceed with these changes to the system installation?"));
+ else
+ ret = flatpak_yes_no_prompt (TRUE, _("Proceed with these changes to the %s installation?"),
+ name ? name : id);
if (!ret)
{