[gnome-software: 22/110] Replace gtk_container_remove() with subclass-specific functions




commit 3499c0e1586b1e24d00c961a6ebe06378b6fad51
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Aug 21 19:58:04 2021 -0300

    Replace gtk_container_remove() with subclass-specific functions
    
    Pretty much the same case of gtk_container_add(). Same consideration about
    AdwDeck.

 src/gs-extras-page.c    | 4 ++--
 src/gs-installed-page.c | 2 +-
 src/gs-shell.c          | 6 +++---
 src/gs-update-dialog.c  | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-extras-page.c b/src/gs-extras-page.c
index 72de050e5..cb2e862bc 100644
--- a/src/gs-extras-page.c
+++ b/src/gs-extras-page.c
@@ -302,8 +302,8 @@ gs_extras_page_add_app (GsExtrasPage *self, GsApp *app, GsAppList *list, SearchD
 
                existing_app = gs_app_row_get_app (GS_APP_ROW (l->data));
                if (app == existing_app)
-                       gtk_container_remove (GTK_CONTAINER (self->list_box_results),
-                                             GTK_WIDGET (l->data));
+                       gtk_list_box_remove (GTK_LIST_BOX (self->list_box_results),
+                                            GTK_WIDGET (l->data));
        }
 
        app_row = gs_app_row_new (app);
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 21d1fa334..de8485c0e 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -115,7 +115,7 @@ row_unrevealed (GObject *row, GParamSpec *pspec, gpointer data)
        list = gtk_widget_get_parent (GTK_WIDGET (row));
        if (list == NULL)
                return;
-       gtk_container_remove (GTK_CONTAINER (list), GTK_WIDGET (row));
+       gtk_list_box_remove (GTK_LIST_BOX (list), GTK_WIDGET (row));
 }
 
 static void
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 11f77dd03..f49a8b87e 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -185,7 +185,7 @@ gs_shell_set_header_start_widget (GsShell *shell, GtkWidget *widget)
        shell->header_start_widget = widget;
 
        if (old_widget != NULL) {
-               gtk_container_remove (GTK_CONTAINER (shell->main_header), old_widget);
+               adw_header_bar_remove (ADW_HEADER_BAR (shell->main_header), old_widget);
                g_object_unref (old_widget);
        }
 }
@@ -208,7 +208,7 @@ gs_shell_set_header_end_widget (GsShell *shell, GtkWidget *widget)
        shell->header_end_widget = widget;
 
        if (old_widget != NULL) {
-               gtk_container_remove (GTK_CONTAINER (shell->main_header), old_widget);
+               adw_header_bar_remove (ADW_HEADER_BAR (shell->main_header), old_widget);
                g_object_unref (old_widget);
        }
 }
@@ -231,7 +231,7 @@ gs_shell_set_details_header_end_widget (GsShell *shell, GtkWidget *widget)
        shell->details_header_end_widget = widget;
 
        if (old_widget != NULL) {
-               gtk_container_remove (GTK_CONTAINER (shell->details_header), old_widget);
+               adw_header_bar_remove (ADW_HEADER_BAR (shell->details_header), old_widget);
                g_object_unref (old_widget);
        }
 }
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 67b6cf3ee..37d492ac8 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -308,7 +308,7 @@ gs_update_dialog_constructed (GObject *object)
                GtkWidget *child;
 
                child = adw_deck_get_visible_child (ADW_DECK (dialog->deck));
-               gtk_container_remove (GTK_CONTAINER (dialog->deck), child);
+               adw_deck_remove (ADW_DECK (dialog->deck), child);
 
                gs_update_dialog_show_update_details (dialog, dialog->app);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]