From a4b16255d5a4e83f39cff3ad73c9572de4e1d092 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 3 May 2017 11:28:07 +0200 Subject: [PATCH] info/list: Move subpath list to info We just show "partial" on the list and then the details are in flatpak info. --- app/flatpak-builtins-info.c | 10 ++++++++++ app/flatpak-builtins-list.c | 19 +++---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/flatpak-builtins-info.c b/app/flatpak-builtins-info.c index 9277fe33..95f1f260 100644 --- a/app/flatpak-builtins-info.c +++ b/app/flatpak-builtins-info.c @@ -91,6 +91,7 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * g_autofree char *path = NULL; g_autofree char *formatted = NULL; gboolean friendly = TRUE; + g_autofree const char **subpaths = NULL; context = g_option_context_new (_("NAME [BRANCH] - Get info about installed app and/or runtime")); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); @@ -140,6 +141,7 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * size = flatpak_deploy_data_get_installed_size (deploy_data); formatted = g_format_size (size); path = g_file_get_path (flatpak_deploy_get_dir (deploy)); + subpaths = flatpak_deploy_data_get_subpaths (deploy_data); metakey = flatpak_deploy_get_metadata (deploy); @@ -162,6 +164,14 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * runtime = g_key_file_get_string (metakey, "Application", "runtime", error); g_print ("%s%s%s %s\n", on, _("Runtime:"), off, runtime ? runtime : "-"); } + if (subpaths[0] != NULL) + { + int i; + g_print ("%s%s%s ", on, _("Installed subdirectories:"), off); + for (i = 0; subpaths[i] != NULL; i++) + g_print (i == 0 ? "%s" : ",%s", subpaths[i]); + g_print ("\n"); + } } else { diff --git a/app/flatpak-builtins-list.c b/app/flatpak-builtins-list.c index c6611939..57a7cb85 100644 --- a/app/flatpak-builtins-list.c +++ b/app/flatpak-builtins-list.c @@ -136,9 +136,6 @@ print_table_for_refs (gboolean print_apps, GPtrArray* refs_array, const char *ar } flatpak_table_printer_set_column_title (printer, i++, _("Options")); - if (opt_show_details) - flatpak_table_printer_set_column_title (printer, i++, _("Subpaths")); - for (i = 0; i < refs_array->len; i++) { RefsData *refs_data = NULL; @@ -240,20 +237,10 @@ print_table_for_refs (gboolean print_apps, GPtrArray* refs_array, const char *ar flatpak_table_printer_append_with_comma (printer, "runtime"); } - if (opt_show_details) + subpaths = flatpak_deploy_data_get_subpaths (deploy_data); + if (subpaths[0] != NULL) { - subpaths = flatpak_deploy_data_get_subpaths (deploy_data); - if (subpaths[0] == NULL) - { - flatpak_table_printer_add_column (printer, ""); - } - else - { - int i; - flatpak_table_printer_add_column (printer, ""); /* subpaths */ - for (i = 0; subpaths[i] != NULL; i++) - flatpak_table_printer_append_with_comma (printer, subpaths[i]); - } + flatpak_table_printer_append_with_comma (printer, "partial"); } flatpak_table_printer_finish_row (printer); }