[gnome-commander: 164/170] Use accessor functions instead of direct access




commit 62aa6eda9c5d52a5f3a35423efe44e9d2496d305
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Jun 21 15:29:46 2020 +0200

    Use accessor functions instead of direct access

 libgcmd/libgcmd-widget-factory.cc         | 4 ++--
 src/dialogs/gnome-cmd-advrename-dialog.cc | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libgcmd/libgcmd-widget-factory.cc b/libgcmd/libgcmd-widget-factory.cc
index 6dad5746..dd0ed4c3 100644
--- a/libgcmd/libgcmd-widget-factory.cc
+++ b/libgcmd/libgcmd-widget-factory.cc
@@ -32,7 +32,7 @@ GtkWidget *lookup_widget (GtkWidget *widget, const gchar *widget_name)
 
     for (;;)
     {
-        parent = GTK_IS_MENU (widget) ? gtk_menu_get_attach_widget (GTK_MENU (widget)) : widget->parent;
+        parent = GTK_IS_MENU (widget) ? gtk_menu_get_attach_widget (GTK_MENU (widget)) : 
gtk_widget_get_parent(widget);
         if (!parent)
             break;
         widget = parent;
@@ -204,7 +204,7 @@ GtkWidget *create_named_button_with_data (GtkWidget *parent, const gchar *label,
     GtkAccelGroup *accel_group = gtk_accel_group_new ();
     GtkWidget *w = gtk_button_new_with_label ("");
 
-    key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (w)->child), label);
+    key = gtk_label_parse_uline (GTK_LABEL (gtk_bin_get_child( GTK_BIN (w))), label);
     gtk_widget_add_accelerator (w, "clicked", accel_group, key, GDK_MOD1_MASK, (GtkAccelFlags) 0);
     gtk_window_add_accel_group (GTK_WINDOW (parent), accel_group);
     g_object_ref (w);
diff --git a/src/dialogs/gnome-cmd-advrename-dialog.cc b/src/dialogs/gnome-cmd-advrename-dialog.cc
index 3dd410ae..7ed25658 100644
--- a/src/dialogs/gnome-cmd-advrename-dialog.cc
+++ b/src/dialogs/gnome-cmd-advrename-dialog.cc
@@ -186,7 +186,7 @@ void GnomeCmdAdvrenameDialog::Private::manage_profiles(GnomeCmdAdvrenameDialog::
 
     if 
(GnomeCmd::ManageProfilesDialog<GnomeCmdData::AdvrenameConfig,GnomeCmdData::AdvrenameConfig::Profile,GnomeCmdAdvrenameProfileComponent>
 (GTK_WINDOW (dialog),cfg,new_profile,_("Profiles"),"gnome-commander-advanced-rename"))
     {
-        GtkWidget *menu = widget->parent;
+        GtkWidget *menu = gtk_widget_get_parent(widget);
 
         gnome_cmd_button_menu_disconnect_handler (priv->profile_menu_button, menu);
         g_object_unref (gtk_item_factory_from_widget (menu));
@@ -524,11 +524,11 @@ static void gnome_cmd_advrename_dialog_init (GnomeCmdAdvrenameDialog *dialog)
     gtk_window_set_resizable (*dialog, TRUE);
     gtk_dialog_set_has_separator (*dialog, FALSE);
     gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-    gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+    gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), 2);
 
     GtkWidget *vbox = dialog->priv->vbox = gtk_vbox_new (FALSE, 6);
     gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
-    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
+    gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), vbox, TRUE, TRUE, 0);
 
     // Results
     gchar *str = g_strdup_printf ("<b>%s</b>", _("Results"));


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