[gnome-software: 29/110] Replace leftover GtkBin API usage
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 29/110] Replace leftover GtkBin API usage
- Date: Tue, 5 Oct 2021 20:32:36 +0000 (UTC)
commit dcf20f74249851a10d39a2baee3976d3e96858af
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Aug 22 21:24:32 2021 -0300
Replace leftover GtkBin API usage
Use widget-specific functions instead of gtk_bin_get_child().
src/gs-category-page.c | 4 ++--
src/gs-first-run-dialog.c | 2 +-
src/gs-installed-page.c | 6 ------
src/gs-os-update-page.c | 8 ++++----
src/gs-removal-dialog.c | 4 ++--
src/gs-screenshot-carousel.c | 2 +-
6 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index 6a0a7325f..85d549e8f 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -455,8 +455,8 @@ recently_updated_sort_cb (GtkFlowBoxChild *child1,
GtkFlowBoxChild *child2,
gpointer user_data)
{
- GsSummaryTile *tile1 = GS_SUMMARY_TILE (gtk_bin_get_child (GTK_BIN (child1)));
- GsSummaryTile *tile2 = GS_SUMMARY_TILE (gtk_bin_get_child (GTK_BIN (child2)));
+ GsSummaryTile *tile1 = GS_SUMMARY_TILE (gtk_flow_box_child_get_child (child1));
+ GsSummaryTile *tile2 = GS_SUMMARY_TILE (gtk_flow_box_child_get_child (child2));
GsApp *app1 = gs_app_tile_get_app (GS_APP_TILE (tile1));
GsApp *app2 = gs_app_tile_get_app (GS_APP_TILE (tile2));
guint64 release_date1 = 0, release_date2 = 0;
diff --git a/src/gs-first-run-dialog.c b/src/gs-first-run-dialog.c
index 3b771ef8d..80b76f3ce 100644
--- a/src/gs-first-run-dialog.c
+++ b/src/gs-first-run-dialog.c
@@ -63,7 +63,7 @@ gs_first_run_dialog_init (GsFirstRunDialog *dialog)
gtk_widget_init_template (GTK_WIDGET (dialog));
- button_label = gtk_bin_get_child (GTK_BIN (dialog->button));
+ button_label = gtk_button_get_child (GTK_BUTTON (dialog->button));
gtk_widget_set_margin_start (button_label, 16);
gtk_widget_set_margin_end (button_label, 16);
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 7c451673d..6f2dcde78 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -461,12 +461,6 @@ gs_installed_page_sort_func (GtkListBoxRow *a,
g_autofree gchar *key1 = NULL;
g_autofree gchar *key2 = NULL;
- /* check valid */
- if (!GTK_IS_BIN(a) || !GTK_IS_BIN(b)) {
- g_warning ("GtkListBoxRow not valid");
- return 0;
- }
-
a1 = gs_app_row_get_app (GS_APP_ROW (a));
a2 = gs_app_row_get_app (GS_APP_ROW (b));
key1 = gs_installed_page_get_app_sort_key (a1);
diff --git a/src/gs-os-update-page.c b/src/gs-os-update-page.c
index 5c935c8e7..b155131d1 100644
--- a/src/gs-os-update-page.c
+++ b/src/gs-os-update-page.c
@@ -68,7 +68,7 @@ row_activated_cb (GtkListBox *list_box,
{
GsApp *app;
- app = GS_APP (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))), "app"));
+ app = GS_APP (g_object_get_data (G_OBJECT (gtk_list_box_row_get_child (row)), "app"));
g_assert (app != NULL);
g_signal_emit (page, signals[SIGNAL_APP_ACTIVATED], 0, app);
@@ -247,8 +247,8 @@ os_updates_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GObject *o1 = G_OBJECT (gtk_bin_get_child (GTK_BIN (a)));
- GObject *o2 = G_OBJECT (gtk_bin_get_child (GTK_BIN (b)));
+ GObject *o1 = G_OBJECT (gtk_list_box_row_get_child (a));
+ GObject *o2 = G_OBJECT (gtk_list_box_row_get_child (b));
GsApp *a1 = g_object_get_data (o1, "app");
GsApp *a2 = g_object_get_data (o2, "app");
const gchar *key1 = gs_app_get_source_default (a1);
@@ -309,7 +309,7 @@ list_header_func (GtkListBoxRow *row,
gpointer user_data)
{
GsOsUpdatePage *page = (GsOsUpdatePage *) user_data;
- GObject *o = G_OBJECT (gtk_bin_get_child (GTK_BIN (row)));
+ GObject *o = G_OBJECT (gtk_list_box_row_get_child (row));
GsApp *app = g_object_get_data (o, "app");
GtkWidget *header = NULL;
diff --git a/src/gs-removal-dialog.c b/src/gs-removal-dialog.c
index 20e4318db..e79c22fd0 100644
--- a/src/gs-removal-dialog.c
+++ b/src/gs-removal-dialog.c
@@ -28,8 +28,8 @@ list_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GObject *o1 = G_OBJECT (gtk_bin_get_child (GTK_BIN (a)));
- GObject *o2 = G_OBJECT (gtk_bin_get_child (GTK_BIN (b)));
+ GObject *o1 = G_OBJECT (gtk_list_box_row_get_child (a));
+ GObject *o2 = G_OBJECT (gtk_list_box_row_get_child (b));
const gchar *key1 = g_object_get_data (o1, "sort");
const gchar *key2 = g_object_get_data (o2, "sort");
return g_strcmp0 (key1, key2);
diff --git a/src/gs-screenshot-carousel.c b/src/gs-screenshot-carousel.c
index bd7aa6f74..b30d5eeac 100644
--- a/src/gs-screenshot-carousel.c
+++ b/src/gs-screenshot-carousel.c
@@ -130,7 +130,7 @@ gs_screenshot_carousel_load_screenshots (GsScreenshotCarousel *self, GsApp *app,
for (guint i = 0; i < screenshots->len && !g_cancellable_is_cancelled (cancellable); i++) {
AsScreenshot *ss = g_ptr_array_index (screenshots, i);
GtkWidget *ssimg = gs_screenshot_image_new (self->session);
- gtk_widget_set_can_focus (gtk_bin_get_child (GTK_BIN (ssimg)), FALSE);
+ gtk_widget_set_can_focus (gtk_widget_get_first_child (ssimg), FALSE);
gs_screenshot_image_set_screenshot (GS_SCREENSHOT_IMAGE (ssimg), ss);
gs_screenshot_image_set_size (GS_SCREENSHOT_IMAGE (ssimg),
AS_IMAGE_NORMAL_WIDTH,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]