[dia] Don't use deprecated function gtk_object_sink().
- From: Hans Breuer <hans src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [dia] Don't use deprecated function gtk_object_sink().
- Date: Fri, 31 Jul 2009 16:58:29 +0000 (UTC)
commit 47525c8cdc6ecd81ba010c1c5a21cb6d11a56d15
Author: Adam Buchbinder <adam buchbinder gmail com>
Date: Tue Jul 28 13:59:41 2009 -0400
Don't use deprecated function gtk_object_sink().
Replaced g_object_ref(G_OBJECT(foo)) followed by
gtk_object_sink(GTK_OBJECT(foo)) with a single call to
g_object_ref_sink(foo). This requires glib 2.10+, but we already
require that in configure.in.
http://library.gnome.org/devel/gtk/stable/GtkObject.html#gtk-object-sink
http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/107594
Signed-off-by: Hans Breuer <hans breuer org>
lib/diaarrowchooser.c | 5 ++---
lib/object.h | 3 +--
lib/widgets.c | 6 ++----
objects/Database/table_dialog.c | 3 +--
objects/SISSI/sissi_dialog.c | 3 +--
objects/UML/class_dialog.c | 3 +--
6 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/lib/diaarrowchooser.c b/lib/diaarrowchooser.c
index c9cd77a..732d89d 100644
--- a/lib/diaarrowchooser.c
+++ b/lib/diaarrowchooser.c
@@ -23,7 +23,7 @@
* \ingroup diawidgets
*/
#include <config.h>
-#undef GTK_DISABLE_DEPRECATED /* gtk_object_sink */
+#undef GTK_DISABLE_DEPRECATED /* GtkDestroyNotify */
#include <gtk/gtk.h>
#include "intl.h"
#include "widgets.h"
@@ -426,8 +426,7 @@ dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback,
chooser->user_data = user_data;
menu = gtk_menu_new();
- g_object_ref(G_OBJECT(menu));
- gtk_object_sink(GTK_OBJECT(menu));
+ g_object_ref_sink(menu);
g_object_set_data_full(G_OBJECT(chooser), button_menu_key, menu,
(GtkDestroyNotify)g_object_unref);
/* although from ARROW_NONE to MAX_ARROW_TYPE-1 this is sorted by *index* to keep the order consistent with earlier releases */
diff --git a/lib/object.h b/lib/object.h
index 959187c..0ad570b 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -252,8 +252,7 @@ typedef ObjectChange* (*MoveHandleFunc) (DiaObject* obj,
* Note that if you want to use the same dialog multiple times,
* you should ref it first. Just run the following on the widget
* when you create it:
- * gtk_object_ref(GTK_OBJECT(widget));
- * gtk_object_sink(GTK_OBJECT(widget)); / * optional, but recommended * /
+ * g_object_ref_sink(widget);
* If you don't do this, the widget will be destroyed when the
* properties dialog is closed.
*/
diff --git a/lib/widgets.c b/lib/widgets.c
index e9b3836..5563d2f 100644
--- a/lib/widgets.c
+++ b/lib/widgets.c
@@ -2170,13 +2170,11 @@ dia_toggle_button_new(GtkWidget *on_widget, GtkWidget *off_widget)
/* Since these may not be added at any point, make sure to
* sink them. */
images->on = on_widget;
- g_object_ref(G_OBJECT(images->on));
- gtk_object_sink(GTK_OBJECT(images->on));
+ g_object_ref_sink(images->on);
gtk_widget_show(images->on);
images->off = off_widget;
- g_object_ref(G_OBJECT(images->off));
- gtk_object_sink(GTK_OBJECT(images->off));
+ g_object_ref_sink(images->off);
gtk_widget_show(images->off);
/* Make border as small as possible */
diff --git a/objects/Database/table_dialog.c b/objects/Database/table_dialog.c
index 4cb543b..049a457 100644
--- a/objects/Database/table_dialog.c
+++ b/objects/Database/table_dialog.c
@@ -152,8 +152,7 @@ table_get_properties_dialog (Table * table, gboolean is_default)
table->prop_dialog = prop_dialog;
vbox = gtk_vbox_new (FALSE, 0);
- gtk_object_ref (GTK_OBJECT(vbox));
- gtk_object_sink (GTK_OBJECT(vbox));
+ g_object_ref_sink(vbox);
prop_dialog->dialog = vbox;
notebook = gtk_notebook_new ();
diff --git a/objects/SISSI/sissi_dialog.c b/objects/SISSI/sissi_dialog.c
index ae86429..7999ade 100644
--- a/objects/SISSI/sissi_dialog.c
+++ b/objects/SISSI/sissi_dialog.c
@@ -1143,8 +1143,7 @@ extern GtkWidget *object_sissi_get_properties_dialog(ObjetSISSI *object_sissi, g
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_object_ref(GTK_OBJECT(vbox));
- gtk_object_sink(GTK_OBJECT(vbox));
+ g_object_ref_sink(vbox);
prop_dialog->dialog = vbox;
diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c
index 3c5e467..4071731 100644
--- a/objects/UML/class_dialog.c
+++ b/objects/UML/class_dialog.c
@@ -3040,8 +3040,7 @@ umlclass_get_properties(UMLClass *umlclass, gboolean is_default)
umlclass->properties_dialog = prop_dialog;
vbox = gtk_vbox_new(FALSE, 0);
- gtk_object_ref(GTK_OBJECT(vbox));
- gtk_object_sink(GTK_OBJECT(vbox));
+ g_object_ref_sink(vbox);
prop_dialog->dialog = vbox;
prop_dialog->current_attr = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]