diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-01-31 15:30:29 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-02-01 16:30:17 +0000 |
commit | d5e29707253b650e28576217f53bbe9230d89173 (patch) | |
tree | ee84ab01c0099ba28e6c638207036d794162479c | |
parent | 5a08abb3992c103aac620937be36070f34ff667d (diff) | |
download | flatpak-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.c | 13 |
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) { |