diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-04-27 10:23:04 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-04-27 10:23:04 +0200 |
commit | e4d3a7da5a2d5fa4aef4904721b0339baf850c51 (patch) | |
tree | 2cd4d83fe9c6e0264c3b85346bb7a0ab0220cbda /app | |
parent | be71ceb31f715074d10d4c4e37e39ba72f0c7549 (diff) | |
download | xdg-app-e4d3a7da5a2d5fa4aef4904721b0339baf850c51.tar.gz |
list: Show installed size and subpaths
Diffstat (limited to 'app')
-rw-r--r-- | app/xdg-app-builtins-list.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/xdg-app-builtins-list.c b/app/xdg-app-builtins-list.c index 9c8423c..d6b582a 100644 --- a/app/xdg-app-builtins-list.c +++ b/app/xdg-app-builtins-list.c @@ -152,6 +152,9 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo { g_autofree char *active = xdg_app_dir_read_active (dir, ref, NULL); g_autofree char *latest = NULL; + g_autofree char *size_s = NULL; + guint64 size = 0; + g_auto(GStrv) subpaths = NULL; latest = xdg_app_dir_read_latest (dir, repo, ref, NULL, NULL); if (latest) @@ -174,6 +177,13 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo xdg_app_table_printer_add_column (printer, active); xdg_app_table_printer_add_column (printer, latest); + if (xdg_app_dir_get_installed_size (dir, active, &size, cancellable, NULL)) + size_s = g_format_size (size); + else + size_s = g_strdup ("?"); + xdg_app_table_printer_add_column (printer, size_s); + + xdg_app_table_printer_add_column (printer, ""); /* Options */ if (print_user && print_system) @@ -192,6 +202,17 @@ print_installed_refs (gboolean app, gboolean runtime, gboolean print_system, gbo if (app) xdg_app_table_printer_append_with_comma (printer, "runtime"); } + + subpaths = xdg_app_dir_get_subpaths (dir, ref, cancellable, NULL); + if (subpaths == NULL || subpaths[0] == NULL) + xdg_app_table_printer_add_column (printer, ""); + else + { + int i; + xdg_app_table_printer_add_column (printer, ""); /* subpaths */ + for (i = 0; subpaths[i] != NULL; i++) + xdg_app_table_printer_append_with_comma (printer, subpaths[i]); + } } else { |