[gnome-software: 104/110] Use gtk_list_box_append()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 104/110] Use gtk_list_box_append()
- Date: Tue, 5 Oct 2021 20:32:46 +0000 (UTC)
commit 40de1d5867d737385fc78cd53929977b829b45dd
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Sep 28 17:57:08 2021 -0300
Use gtk_list_box_append()
Unlike GtkFlowBox, GtkListBox has an append() method. Use it instead.
src/gs-age-rating-context-dialog.c | 2 +-
src/gs-app-version-history-dialog.c | 4 ++--
src/gs-details-page.c | 6 +++---
src/gs-extras-page.c | 2 +-
src/gs-hardware-support-context-dialog.c | 2 +-
src/gs-installed-page.c | 8 ++++----
src/gs-moderate-page.c | 4 ++--
src/gs-os-update-page.c | 2 +-
src/gs-safety-context-dialog.c | 2 +-
src/gs-search-page.c | 4 ++--
src/gs-storage-context-dialog.c | 2 +-
src/gs-update-list.c | 2 +-
src/gs-updates-section.c | 2 +-
13 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/gs-age-rating-context-dialog.c b/src/gs-age-rating-context-dialog.c
index c8c60f7b2..aeb757aa8 100644
--- a/src/gs-age-rating-context-dialog.c
+++ b/src/gs-age-rating-context-dialog.c
@@ -364,7 +364,7 @@ add_attribute_row (GtkListBox *list_box,
title = content_rating_attribute_get_title (attribute);
row = gs_context_dialog_row_new (icon_name, rating, title, description);
- gtk_list_box_insert (list_box, GTK_WIDGET (row), -1);
+ gtk_list_box_append (list_box, GTK_WIDGET (row));
}
/**
diff --git a/src/gs-app-version-history-dialog.c b/src/gs-app-version-history-dialog.c
index 6ebb9bb52..e6e04a9e3 100644
--- a/src/gs-app-version-history-dialog.c
+++ b/src/gs-app-version-history-dialog.c
@@ -40,7 +40,7 @@ populate_version_history (GsAppVersionHistoryDialog *dialog,
gs_app_version_history_row_set_info (GS_APP_VERSION_HISTORY_ROW (row),
gs_app_get_version (app),
gs_app_get_release_date (app), NULL);
- gtk_list_box_insert (GTK_LIST_BOX (dialog->listbox), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (dialog->listbox), row);
gtk_widget_show (row);
return;
}
@@ -56,7 +56,7 @@ populate_version_history (GsAppVersionHistoryDialog *dialog,
as_release_get_timestamp (version),
as_release_get_description (version));
- gtk_list_box_insert (GTK_LIST_BOX (dialog->listbox), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (dialog->listbox), row);
gtk_widget_show (row);
}
}
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 198400b8d..e0a7ad2b5 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -725,7 +725,7 @@ gs_details_page_get_alternates_cb (GObject *source_object,
}
gs_origin_popover_row_set_size_group (GS_ORIGIN_POPOVER_ROW (row),
self->size_group_origin_popover);
- gtk_list_box_insert (GTK_LIST_BOX (self->origin_popover_list_box), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->origin_popover_list_box), row);
if (origin_by_packaging_format) {
const gchar *packaging_format = gs_app_get_packaging_format_raw (app);
@@ -1217,7 +1217,7 @@ gs_details_page_refresh_addons (GsDetailsPage *self)
G_CALLBACK (gs_details_page_addon_remove_cb),
self);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_addons), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_addons), row);
gtk_widget_show (row);
}
@@ -1374,7 +1374,7 @@ gs_details_page_refresh_reviews (GsDetailsPage *self)
actions = possible_actions & ~(1u << GS_REVIEW_ACTION_REMOVE);
}
gs_review_row_set_actions (GS_REVIEW_ROW (row), actions);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_reviews), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_reviews), row);
gtk_widget_set_visible (row, self->show_all_reviews ||
i < SHOW_NR_REVIEWS_INITIAL);
gs_review_row_set_network_available (GS_REVIEW_ROW (row),
diff --git a/src/gs-extras-page.c b/src/gs-extras-page.c
index 4d45e944a..df084eba9 100644
--- a/src/gs-extras-page.c
+++ b/src/gs-extras-page.c
@@ -315,7 +315,7 @@ gs_extras_page_add_app (GsExtrasPage *self, GsApp *app, GsAppList *list, SearchD
G_CALLBACK (app_row_button_clicked_cb),
self);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_results), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_results), app_row);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
diff --git a/src/gs-hardware-support-context-dialog.c b/src/gs-hardware-support-context-dialog.c
index f4a049803..e10d0c49a 100644
--- a/src/gs-hardware-support-context-dialog.c
+++ b/src/gs-hardware-support-context-dialog.c
@@ -143,7 +143,7 @@ add_relation_row (GtkListBox *list_box,
*chosen_rating = rating;
row = gs_context_dialog_row_new (icon_name, rating, title, description);
- gtk_list_box_insert (list_box, GTK_WIDGET (row), -1);
+ gtk_list_box_append (list_box, GTK_WIDGET (row));
}
/**
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 5cc5e5ccb..14628cc58 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -253,16 +253,16 @@ gs_installed_page_add_app (GsInstalledPage *self, GsAppList *list, GsApp *app)
switch (gs_installed_page_get_app_section (app)) {
case GS_UPDATE_LIST_SECTION_INSTALLING_AND_REMOVING:
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_in_progress), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install_in_progress), app_row);
break;
case GS_UPDATE_LIST_SECTION_REMOVABLE_APPS:
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_apps), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install_apps), app_row);
break;
case GS_UPDATE_LIST_SECTION_SYSTEM_APPS:
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_system_apps), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install_system_apps), app_row);
break;
case GS_UPDATE_LIST_SECTION_ADDONS:
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_addons), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install_addons), app_row);
break;
default:
g_assert_not_reached ();
diff --git a/src/gs-moderate-page.c b/src/gs-moderate-page.c
index a36247e08..f59ec21b4 100644
--- a/src/gs-moderate-page.c
+++ b/src/gs-moderate-page.c
@@ -158,7 +158,7 @@ gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
/* add top level app */
app_row = gs_app_row_new (app);
gs_app_row_set_show_buttons (GS_APP_ROW (app_row), TRUE);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install), app_row);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
@@ -183,7 +183,7 @@ gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
g_object_set_data_full (G_OBJECT (row), "GsApp",
g_object_ref (app),
(GDestroyNotify) g_object_unref);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_install), row);
}
gtk_widget_show (app_row);
}
diff --git a/src/gs-os-update-page.c b/src/gs-os-update-page.c
index 483832e3d..68d94da3a 100644
--- a/src/gs-os-update-page.c
+++ b/src/gs-os-update-page.c
@@ -421,7 +421,7 @@ gs_os_update_page_set_app (GsOsUpdatePage *page, GsApp *app)
create_section (page, section);
row = create_app_row (app_related);
- gtk_list_box_insert (GTK_LIST_BOX (page->list_boxes[section]), row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (page->list_boxes[section]), row);
}
} else {
adw_window_title_set_title (page->window_title, NULL);
diff --git a/src/gs-safety-context-dialog.c b/src/gs-safety-context-dialog.c
index 27f3c090d..3b82b626a 100644
--- a/src/gs-safety-context-dialog.c
+++ b/src/gs-safety-context-dialog.c
@@ -100,7 +100,7 @@ add_permission_row (GtkListBox *list_box,
has_permission ? item_rating :
GS_CONTEXT_DIALOG_ROW_IMPORTANCE_UNIMPORTANT,
has_permission ? title_with_permission : title_without_permission,
has_permission ? description_with_permission :
description_without_permission);
- gtk_list_box_insert (list_box, GTK_WIDGET (row), -1);
+ gtk_list_box_append (list_box, GTK_WIDGET (row));
}
static void
diff --git a/src/gs-search-page.c b/src/gs-search-page.c
index 96954faec..055bb7a68 100644
--- a/src/gs-search-page.c
+++ b/src/gs-search-page.c
@@ -151,7 +151,7 @@ gs_search_page_get_search_cb (GObject *source_object,
g_signal_connect (app_row, "button-clicked",
G_CALLBACK (gs_search_page_app_row_clicked_cb),
self);
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_search), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_search), app_row);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
@@ -180,7 +180,7 @@ gs_search_page_get_search_cb (GObject *source_object,
gtk_widget_set_margin_end (w, 20);
context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, "dim-label");
- gtk_list_box_insert (GTK_LIST_BOX (self->list_box_search), w, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_search), w);
gtk_widget_show (w);
} else {
/* reset to default */
diff --git a/src/gs-storage-context-dialog.c b/src/gs-storage-context-dialog.c
index 4ccbf26b9..4699f5c65 100644
--- a/src/gs-storage-context-dialog.c
+++ b/src/gs-storage-context-dialog.c
@@ -97,7 +97,7 @@ add_size_row (GtkListBox *list_box,
row = gs_context_dialog_row_new_text (size_bytes_str, GS_CONTEXT_DIALOG_ROW_IMPORTANCE_NEUTRAL,
title, description);
gs_context_dialog_row_set_size_groups (GS_CONTEXT_DIALOG_ROW (row), lozenge_size_group, NULL, NULL);
- gtk_list_box_insert (list_box, GTK_WIDGET (row), -1);
+ gtk_list_box_append (list_box, GTK_WIDGET (row));
}
static void
diff --git a/src/gs-update-list.c b/src/gs-update-list.c
index ac0a03df6..0c12578a0 100644
--- a/src/gs-update-list.c
+++ b/src/gs-update-list.c
@@ -61,7 +61,7 @@ gs_update_list_add_app (GsUpdateList *update_list, GsApp *app)
gs_app_row_set_show_description (GS_APP_ROW (app_row), FALSE);
gs_app_row_set_show_update (GS_APP_ROW (app_row), FALSE);
gs_app_row_set_show_buttons (GS_APP_ROW (app_row), FALSE);
- gtk_list_box_insert (priv->listbox, app_row, -1);
+ gtk_list_box_append (priv->listbox, app_row);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
priv->sizegroup_image,
priv->sizegroup_name,
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 5edd774bd..c9b42f742 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -142,7 +142,7 @@ gs_updates_section_add_app (GsUpdatesSection *self, GsApp *app)
g_signal_connect (app_row, "button-clicked",
G_CALLBACK (_app_row_button_clicked_cb),
self);
- gtk_list_box_insert (GTK_LIST_BOX (self->listbox), app_row, -1);
+ gtk_list_box_append (GTK_LIST_BOX (self->listbox), app_row);
gs_app_list_add (self->list, app);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]