After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630972 - drop GtkObject use
drop GtkObject use
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.90.x
Other All
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks: 630874
 
 
Reported: 2010-09-30 00:53 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-09-30 21:16 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
drop GtkObject use (8.10 KB, patch)
2010-09-30 00:55 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
drop GtkObject use.v2 (8.33 KB, patch)
2010-09-30 14:51 UTC, Javier Jardón (IRC: jjardon)
none Details | Review

Description Javier Jardón (IRC: jjardon) 2010-09-30 00:53:10 UTC
GtkObject is gone in GTK3. See
http://live.gnome.org/GnomeGoals/GtkObjectRemoval
Comment 1 Javier Jardón (IRC: jjardon) 2010-09-30 00:55:50 UTC
Created attachment 171393 [details] [review]
drop GtkObject use
Comment 2 Ignacio Casal Quinteiro (nacho) 2010-09-30 06:37:20 UTC
Review of attachment 171393 [details] [review]:

It looks good to me, second opinion here?
Comment 3 Paolo Borelli 2010-09-30 07:02:13 UTC
Review of attachment 171393 [details] [review]:

when doing inheritance we should just override dispose instead of destroy, they are equivalent and dispose is more consistent with all other gobjects. The only place where destroy should be kept is when you are connecting to another object destruction

::: gedit/gedit-history-entry.c
@@ -118,2 @@
 static void
-gedit_history_entry_destroy (GtkObject *object)

we should simply move to dispose and the code should me made robust against multiple invocations

::: gedit/gedit-overlay.c
@@ -165,2 @@
 static void
-gedit_overlay_destroy (GtkObject *object)

move to dispose

::: gedit/gedit-view.c
@@ +78,2 @@
 static void	gedit_view_finalize		(GObject          *object);
+static void     gedit_view_destroy              (GtkWidget        *widget);

move to dispose

::: plugins/spell/gedit-spell-checker-dialog.c
@@ +114,2 @@
 static void
+gedit_spell_checker_dialog_destroy (GtkWidget *widget)

move to dispose
Comment 4 Javier Jardón (IRC: jjardon) 2010-09-30 14:51:23 UTC
Created attachment 171433 [details] [review]
drop GtkObject use.v2

Updated patch using ->dipose instead ->destroy
Comment 5 Paolo Borelli 2010-09-30 21:16:02 UTC
Review of attachment 171433 [details] [review]:

Javier, thanks for the patch, I do appreciate it. However I think you should put more attention to detail in this porting work, otherwise we risk to introduce a lot of subtle bugs across the whole gnome stack. We really need to take the time to read the code and check the changes, otherwise we would be doing these refactorings with sed :-)

Anyway, I fixed up the patch and pushed.

::: gedit/gedit-history-entry.c
@@ +122,3 @@
 						   FALSE);
 
+	G_OBJECT_CLASS (gedit_history_entry_parent_class)->dispose (widget);

here, you pass "widget", which does not exist

::: gedit/gedit-view.c
@@ -423,2 +422,2 @@
 static void
-gedit_view_destroy (GtkObject *object)
+gedit_view_dispose (GObject *object)

I know I was the one suggesting it, but taking a quick glance at the code you can notice that there is a big fat comment explaining that function closely relates to GtkTextView::destroy, so we should keep it that way.