[gnome-commander] Replacing obsoleted gtk_object_set_data_full() with g_object_set_data_full()
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-commander] Replacing obsoleted gtk_object_set_data_full() with g_object_set_data_full()
- Date: Mon, 28 Sep 2009 22:41:24 +0000 (UTC)
commit 427ed380e48276a10be69fa24287c33428e2b3dc
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Mon Sep 28 23:35:02 2009 +0200
Replacing obsoleted gtk_object_set_data_full() with g_object_set_data_full()
src/gnome-cmd-file-selector.cc | 25 +++++++++----------------
src/gnome-cmd-main-win.cc | 2 +-
src/gnome-cmd-prepare-copy-dialog.cc | 8 ++++----
src/gnome-cmd-prepare-move-dialog.cc | 6 +++---
src/gnome-cmd-remote-dialog.cc | 2 +-
src/gnome-cmd-search-dialog.cc | 15 +++++++--------
src/utils.cc | 8 +++-----
src/widget-factory.h | 2 +-
8 files changed, 29 insertions(+), 39 deletions(-)
---
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 15823b0..1d0f3b1 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -813,7 +813,7 @@ static void create_con_buttons (GnomeCmdFileSelector *fs)
GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_widget_ref (hbox);
- gtk_object_set_data_full (GTK_OBJECT (fs), "con-hbox", hbox, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "con-hbox", hbox, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox);
if (pm)
@@ -822,8 +822,7 @@ static void create_con_buttons (GnomeCmdFileSelector *fs)
if (pixmap)
{
gtk_widget_ref (pixmap);
- gtk_object_set_data_full (GTK_OBJECT (fs), "con-pixmap", pixmap,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "con-pixmap", pixmap, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (pixmap);
gtk_box_pack_start (GTK_BOX (hbox), pixmap, TRUE, TRUE, 0);
}
@@ -833,8 +832,7 @@ static void create_con_buttons (GnomeCmdFileSelector *fs)
{
GtkWidget *label = gtk_label_new (gnome_cmd_con_get_alias (con));
gtk_widget_ref (label);
- gtk_object_set_data_full (GTK_OBJECT (fs), "con-label", label,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "con-label", label, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
}
@@ -1143,13 +1141,13 @@ static void init (GnomeCmdFileSelector *fs)
// create the list
fs->file_list() = new GnomeCmdFileList; // FIXME: file_list() = ...
gtk_widget_ref (*fs->file_list());
- gtk_object_set_data_full (GTK_OBJECT (fs), "list_widget", fs->file_list(), (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "list_widget", fs->file_list(), (GDestroyNotify) gtk_widget_unref);
fs->file_list()->show_column(GnomeCmdFileList::COLUMN_DIR, FALSE);
// create the connection combo
fs->con_combo = gnome_cmd_combo_new (2, 1, NULL);
gtk_widget_ref (fs->con_combo);
- gtk_object_set_data_full (GTK_OBJECT (fs), "con_combo", fs->con_combo, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "con_combo", fs->con_combo, (GDestroyNotify) gtk_widget_unref);
gtk_widget_set_size_request (fs->con_combo, 150, -1);
gtk_clist_set_row_height (GTK_CLIST (GNOME_CMD_COMBO (fs->con_combo)->list), 20);
gtk_entry_set_editable (GTK_ENTRY (GNOME_CMD_COMBO (fs->con_combo)->entry), FALSE);
@@ -1160,30 +1158,25 @@ static void init (GnomeCmdFileSelector *fs)
// create the free space on volume label
fs->vol_label = gtk_label_new ("");
gtk_widget_ref (fs->vol_label);
- gtk_object_set_data_full (GTK_OBJECT (fs), "vol_label", fs->vol_label, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "vol_label", fs->vol_label, (GDestroyNotify) gtk_widget_unref);
gtk_misc_set_alignment (GTK_MISC (fs->vol_label), 1, 0.5);
// create the directory indicator
fs->dir_indicator = gnome_cmd_dir_indicator_new (fs);
gtk_widget_ref (fs->dir_indicator);
- gtk_object_set_data_full (GTK_OBJECT (fs),
- "dir_indicator", fs->dir_indicator,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "dir_indicator", fs->dir_indicator, (GDestroyNotify) gtk_widget_unref);
// create the scrollwindow that we'll place the list in
fs->scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_ref (fs->scrolledwindow);
- gtk_object_set_data_full (GTK_OBJECT (fs),
- "scrolledwindow", fs->scrolledwindow,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "scrolledwindow", fs->scrolledwindow, (GDestroyNotify) gtk_widget_unref);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (fs->scrolledwindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
// create the info label
fs->info_label = gtk_label_new ("not initialized");
gtk_widget_ref (fs->info_label);
- gtk_object_set_data_full (GTK_OBJECT (fs), "infolabel", fs->info_label,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (fs), "infolabel", fs->info_label, (GDestroyNotify) gtk_widget_unref);
gtk_misc_set_alignment (GTK_MISC (fs->info_label), 0.0f, 0.5f);
// pack the widgets
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index 29a0e37..5af9d53 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1242,7 +1242,7 @@ void GnomeCmdMainWin::update_list_orientation()
priv->paned = gnome_cmd_data.list_orientation ? gtk_vpaned_new () : gtk_hpaned_new ();
gtk_widget_ref (priv->paned);
- gtk_object_set_data_full (*this, "paned", priv->paned, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (this), "paned", priv->paned, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (priv->paned);
gtk_paned_pack1 (GTK_PANED (priv->paned), priv->file_selector[LEFT], TRUE, TRUE);
diff --git a/src/gnome-cmd-prepare-copy-dialog.cc b/src/gnome-cmd-prepare-copy-dialog.cc
index 00a74dd..ff6c610 100644
--- a/src/gnome-cmd-prepare-copy-dialog.cc
+++ b/src/gnome-cmd-prepare-copy-dialog.cc
@@ -95,21 +95,21 @@ void gnome_cmd_prepare_copy_dialog_show (GnomeCmdFileSelector *from, GnomeCmdFil
data->silent = gtk_radio_button_new_with_label (group, _("Silently"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->silent));
gtk_widget_ref (data->silent);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "silent", data->silent, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "silent", data->silent, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->silent);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->silent, FALSE, FALSE, 0);
data->query = gtk_radio_button_new_with_label (group, _("Query First"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->query));
gtk_widget_ref (data->query);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "query", data->query, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "query", data->query, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->query);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->query, FALSE, FALSE, 0);
data->skip = gtk_radio_button_new_with_label (group, _("Skip All"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->skip));
gtk_widget_ref (data->skip);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "skip", data->skip, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "skip", data->skip, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->skip);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->skip, FALSE, FALSE, 0);
@@ -118,7 +118,7 @@ void gnome_cmd_prepare_copy_dialog_show (GnomeCmdFileSelector *from, GnomeCmdFil
data->follow_links = gtk_check_button_new_with_label (_("Follow Links"));
gtk_widget_ref (data->follow_links);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "follow_links", data->follow_links, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "follow_links", data->follow_links, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->follow_links);
gtk_box_pack_start (GTK_BOX (data->dialog->right_vbox), data->follow_links, FALSE, FALSE, 0);
diff --git a/src/gnome-cmd-prepare-move-dialog.cc b/src/gnome-cmd-prepare-move-dialog.cc
index e375243..e0af4ed 100644
--- a/src/gnome-cmd-prepare-move-dialog.cc
+++ b/src/gnome-cmd-prepare-move-dialog.cc
@@ -89,21 +89,21 @@ void gnome_cmd_prepare_move_dialog_show (GnomeCmdFileSelector *from, GnomeCmdFil
data->silent = gtk_radio_button_new_with_label (group, _("Silently"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->silent));
gtk_widget_ref (data->silent);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "silent", data->silent, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "silent", data->silent, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->silent);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->silent, FALSE, FALSE, 0);
data->query = gtk_radio_button_new_with_label (group, _("Query First"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->query));
gtk_widget_ref (data->query);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "query", data->query, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "query", data->query, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->query);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->query, FALSE, FALSE, 0);
data->skip = gtk_radio_button_new_with_label (group, _("Skip All"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (data->skip));
gtk_widget_ref (data->skip);
- gtk_object_set_data_full (GTK_OBJECT (data->dialog), "skip", data->skip, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (data->dialog), "skip", data->skip, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (data->skip);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->skip, FALSE, FALSE, 0);
diff --git a/src/gnome-cmd-remote-dialog.cc b/src/gnome-cmd-remote-dialog.cc
index 71cd7c3..d2d844f 100644
--- a/src/gnome-cmd-remote-dialog.cc
+++ b/src/gnome-cmd-remote-dialog.cc
@@ -461,7 +461,7 @@ static void init (GnomeCmdRemoteDialog *ftp_dialog)
ftp_dialog->priv->connection_list = create_view_and_model (get_ftp_cons ());
gtk_widget_ref (ftp_dialog->priv->connection_list);
- gtk_object_set_data_full (GTK_OBJECT (dialog), "connection_list", ftp_dialog->priv->connection_list, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (dialog), "connection_list", ftp_dialog->priv->connection_list, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (ftp_dialog->priv->connection_list);
gtk_container_add (GTK_CONTAINER (sw), ftp_dialog->priv->connection_list);
gtk_widget_set_size_request (ftp_dialog->priv->connection_list, -1, 240);
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 000d52a..fffdedd 100644
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -729,7 +729,7 @@ inline GtkWidget *create_label_with_mnemonic (GtkWidget *parent, const gchar *te
gtk_label_set_mnemonic_widget (GTK_LABEL (label), for_widget);
gtk_widget_ref (label);
- gtk_object_set_data_full (GTK_OBJECT (parent), "label", label, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (parent), "label", label, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (label);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
@@ -744,7 +744,7 @@ inline GtkWidget *create_check_with_mnemonic (GtkWidget *parent, gchar *text, gc
GtkWidget *btn = gtk_check_button_new_with_mnemonic (text);
gtk_widget_ref (btn);
- gtk_object_set_data_full (GTK_OBJECT (parent), name, btn, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (parent), name, btn, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (btn);
return btn;
@@ -758,7 +758,7 @@ inline GtkWidget *create_radio_with_mnemonic (GtkWidget *parent, GSList *group,
GtkWidget *radio = gtk_radio_button_new_with_mnemonic (group, text);
gtk_widget_ref (radio);
- gtk_object_set_data_full (GTK_OBJECT (parent), name, radio, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (parent), name, radio, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (radio);
return radio;
@@ -771,7 +771,7 @@ inline GtkWidget *create_combo_box_entry (GtkWidget *parent)
{
GtkWidget *combo = gtk_combo_box_entry_new_text ();
gtk_widget_ref (combo);
- gtk_object_set_data_full (GTK_OBJECT (parent), "combo", combo, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (parent), "combo", combo, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo);
return combo;
}
@@ -894,14 +894,14 @@ static void init (GnomeCmdSearchDialog *dialog)
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_ref (sw);
- gtk_object_set_data_full (GTK_OBJECT (window), "sw", sw, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (window), "sw", sw, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (sw);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
dialog->priv->result_list = new GnomeCmdFileList;
gtk_widget_ref (GTK_WIDGET (dialog->priv->result_list));
- gtk_object_set_data_full (GTK_OBJECT (window), "result_list", GTK_WIDGET (dialog->priv->result_list), (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (window), "result_list", GTK_WIDGET (dialog->priv->result_list), (GDestroyNotify) gtk_widget_unref);
gtk_widget_set_size_request (GTK_WIDGET (dialog->priv->result_list), -1, 200);
gtk_widget_show (GTK_WIDGET (dialog->priv->result_list));
gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (dialog->priv->result_list));
@@ -911,8 +911,7 @@ static void init (GnomeCmdSearchDialog *dialog)
dialog->priv->statusbar = gtk_statusbar_new ();
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (dialog->priv->statusbar), FALSE);
gtk_widget_ref (dialog->priv->statusbar);
- gtk_object_set_data_full (GTK_OBJECT (window), "statusbar", dialog->priv->statusbar,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (window), "statusbar", dialog->priv->statusbar, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (dialog->priv->statusbar);
gtk_box_pack_start (GTK_BOX (vbox), dialog->priv->statusbar, FALSE, TRUE, 0);
diff --git a/src/utils.cc b/src/utils.cc
index cc3e73b..89a5102 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -904,7 +904,7 @@ GtkWidget *create_styled_pixmap_button (const gchar *text, GnomeCmdPixmap *pm)
GtkWidget *label = NULL;
GtkWidget *pixmap = NULL;
- gtk_object_set_data_full (GTK_OBJECT (btn), "hbox", hbox, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (btn), "hbox", hbox, (GDestroyNotify) gtk_widget_unref);
gtk_widget_ref (hbox);
gtk_widget_show (hbox);
@@ -914,8 +914,7 @@ GtkWidget *create_styled_pixmap_button (const gchar *text, GnomeCmdPixmap *pm)
if (pixmap)
{
gtk_widget_ref (pixmap);
- gtk_object_set_data_full (GTK_OBJECT (btn), "pixmap", pixmap,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (btn), "pixmap", pixmap, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (pixmap);
}
}
@@ -924,8 +923,7 @@ GtkWidget *create_styled_pixmap_button (const gchar *text, GnomeCmdPixmap *pm)
{
label = gtk_label_new (text);
gtk_widget_ref (label);
- gtk_object_set_data_full (GTK_OBJECT (btn), "label", label,
- (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (btn), "label", label, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (label);
}
diff --git a/src/widget-factory.h b/src/widget-factory.h
index f295bec..5c4d1c9 100644
--- a/src/widget-factory.h
+++ b/src/widget-factory.h
@@ -28,7 +28,7 @@ inline GtkWidget *create_clist_combo (GtkWidget *parent, gint num_cols, gint tex
{
GtkWidget *combo = gnome_cmd_combo_new (num_cols, text_col, titles);
gtk_widget_ref (combo);
- gtk_object_set_data_full (GTK_OBJECT (parent), "combo", combo, (GtkDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full (G_OBJECT (parent), "combo", combo, (GDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo);
return combo;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]