Skip to content

Commit

Permalink
app: Simplify table printing
Browse files Browse the repository at this point in the history
These commands no longer need to use flatpak_table_printer_print_full().
  • Loading branch information
chrisawi authored and smcv committed Mar 27, 2024
1 parent 2aebcb1 commit ff820e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions app/flatpak-builtins-list.c
Expand Up @@ -112,7 +112,6 @@ print_table_for_refs (gboolean print_apps,
g_autofree char *match_id = NULL;
g_autofree char *match_arch = NULL;
g_autofree char *match_branch = NULL;
int rows, cols;

if (columns[0].name == NULL)
return TRUE;
Expand Down Expand Up @@ -356,9 +355,7 @@ print_table_for_refs (gboolean print_apps,

if (flatpak_table_printer_get_current_row (printer) > 0)
{
flatpak_get_window_size (&rows, &cols);
flatpak_table_printer_print_full (printer, 0, cols, NULL, NULL);
g_print ("\n");
flatpak_table_printer_print (printer);
}

return TRUE;
Expand Down
5 changes: 1 addition & 4 deletions app/flatpak-builtins-remote-ls.c
Expand Up @@ -130,7 +130,6 @@ ls_remote (GHashTable *refs_hash, const char **arches, const char *app_runtime,
g_autofree char *match_branch = NULL;
gboolean need_cache_data = FALSE;
gboolean need_appstream_data = FALSE;
int rows, cols;

printer = flatpak_table_printer_new ();

Expand Down Expand Up @@ -368,9 +367,7 @@ ls_remote (GHashTable *refs_hash, const char **arches, const char *app_runtime,

if (flatpak_table_printer_get_current_row (printer) > 0)
{
flatpak_get_window_size (&rows, &cols);
flatpak_table_printer_print_full (printer, 0, cols, NULL, NULL);
g_print ("\n");
flatpak_table_printer_print (printer);
}

return TRUE;
Expand Down
5 changes: 1 addition & 4 deletions app/flatpak-builtins-search.c
Expand Up @@ -218,7 +218,6 @@ static void
print_matches (Column *columns, GSList *matches)
{
g_autoptr(FlatpakTablePrinter) printer = NULL;
int rows, cols;
GSList *s;

printer = flatpak_table_printer_new ();
Expand All @@ -231,9 +230,7 @@ print_matches (Column *columns, GSList *matches)
print_app (columns, res, printer);
}

flatpak_get_window_size (&rows, &cols);
flatpak_table_printer_print_full (printer, 0, cols, NULL, NULL);
g_print ("\n");
flatpak_table_printer_print (printer);
}

gboolean
Expand Down

0 comments on commit ff820e3

Please sign in to comment.