[gnome-control-center] search: Don't use gtk_widget_show_all



commit 6e3adb656816c877c105722bb2252aec144218d9
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Oct 11 16:21:51 2018 +1300

    search: Don't use gtk_widget_show_all
    
    It is removed in GTK+ 4

 panels/search/cc-search-locations-dialog.c |  8 ++++++--
 panels/search/cc-search-panel.c            | 10 +++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/panels/search/cc-search-locations-dialog.c b/panels/search/cc-search-locations-dialog.c
index 7afbe0e02..37e3afcc7 100644
--- a/panels/search/cc-search-locations-dialog.c
+++ b/panels/search/cc-search-locations-dialog.c
@@ -433,6 +433,7 @@ place_query_info_ready (GObject *source,
   g_clear_object (&place->cancellable);
 
   box = gtk_bin_get_child (GTK_BIN (row));
+  gtk_widget_show (box);
 
   path = g_file_get_path (G_FILE (source));
   if (g_strcmp0 (path, g_get_home_dir ()) == 0)
@@ -441,9 +442,11 @@ place_query_info_ready (GObject *source,
     place->settings_key = TRACKER_KEY_RECURSIVE_DIRECTORIES;
 
   w = gtk_label_new (place->display_name);
+  gtk_widget_show (w);
   gtk_container_add (GTK_CONTAINER (box), w);
 
   w = gtk_switch_new ();
+  gtk_widget_show (w);
   gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
   gtk_box_pack_end (GTK_BOX (box), w, FALSE, FALSE, 0);
   g_settings_bind_with_mapping (tracker_preferences, place->settings_key,
@@ -452,8 +455,6 @@ place_query_info_ready (GObject *source,
                                 switch_tracker_get_mapping,
                                 switch_tracker_set_mapping,
                                 place, NULL);
-
-  gtk_widget_show_all (row);
 }
 
 static void
@@ -509,9 +510,11 @@ create_row_for_place (Place *place)
   GtkWidget *child, *row, *remove_button;
 
   row = gtk_list_box_row_new ();
+  gtk_widget_show (row);
   gtk_list_box_row_set_selectable (GTK_LIST_BOX_ROW (row), FALSE);
   gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
   child = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+  gtk_widget_show (child);
   gtk_container_add (GTK_CONTAINER (row), child);
   g_object_set (row, "margin", 5, "margin-left", 16, NULL);
   g_object_set_data_full (G_OBJECT (row), "place", place, (GDestroyNotify) place_free);
@@ -519,6 +522,7 @@ create_row_for_place (Place *place)
   if (place->place_type == PLACE_OTHER)
     {
       remove_button = gtk_button_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
+      gtk_widget_show (remove_button);
       gtk_style_context_add_class (gtk_widget_get_style_context (remove_button), "flat");
       gtk_box_pack_end (GTK_BOX (child), remove_button, FALSE, FALSE, 2);
 
diff --git a/panels/search/cc-search-panel.c b/panels/search/cc-search-panel.c
index fa70770b3..3624f1535 100644
--- a/panels/search/cc-search-panel.c
+++ b/panels/search/cc-search-panel.c
@@ -439,7 +439,9 @@ search_panel_add_one_app_info (CcSearchPanel *self,
   gtk_widget_set_valign (self->list_box, GTK_ALIGN_FILL);
 
   row = gtk_list_box_row_new ();
+  gtk_widget_show (row);
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+  gtk_widget_show (box);
   gtk_container_add (GTK_CONTAINER (row), box);
   gtk_widget_set_hexpand (box, TRUE);
   gtk_container_set_border_width (GTK_CONTAINER (box), 10);
@@ -455,14 +457,17 @@ search_panel_add_one_app_info (CcSearchPanel *self,
     g_object_ref (icon);
 
   w = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DND);
+  gtk_widget_show (w);
   gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, &height);
   gtk_image_set_pixel_size (GTK_IMAGE (w), MAX (width, height));
   gtk_container_add (GTK_CONTAINER (box), w);
 
   w = gtk_label_new (g_app_info_get_name (app_info));
+  gtk_widget_show (w);
   gtk_container_add (GTK_CONTAINER (box), w);
 
   w = gtk_switch_new ();
+  gtk_widget_show (w);
   gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
   gtk_box_pack_end (GTK_BOX (box), w, FALSE, FALSE, 0);
 
@@ -484,8 +489,6 @@ search_panel_add_one_app_info (CcSearchPanel *self,
                                     switch_settings_mapping_set_default_disabled,
                                     row, NULL);
     }
-
-  gtk_widget_show_all (row);
 }
 
 static void
@@ -693,8 +696,10 @@ cc_search_panel_constructed (GObject *object)
 
   /* add the disable all switch */
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+  gtk_widget_show (box);
 
   widget = gtk_switch_new ();
+  gtk_widget_show (widget);
   gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
   gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 4);
 
@@ -708,7 +713,6 @@ cc_search_panel_constructed (GObject *object)
                           G_BINDING_DEFAULT |
                           G_BINDING_SYNC_CREATE);
 
-  gtk_widget_show_all (box);
   cc_shell_embed_widget_in_header (cc_panel_get_shell (CC_PANEL (self)), box);
 }
 


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