[gtkmm] Gtk::IconInfo: Do not use deprecated copy/free functions.



commit de49486a195bdadf5c0c2251e69dacfbb6b508b8
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 21 13:20:17 2013 +0100

    Gtk::IconInfo: Do not use deprecated copy/free functions.
    
    * gtk/src/iconinfo.[hg|ccg]: Replace use of deprecated
    gtk_icon_info_copy()/free() with g_object_ref()/unref.
    The deprecated functions just call them anyway.
    
    This partly fixes the build with --enable-warnings=fatal

 ChangeLog            |   10 ++++++++++
 gtk/src/iconinfo.ccg |   12 ++++++++++++
 gtk/src/iconinfo.hg  |    4 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9634979..832ae7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-02-21  Murray Cumming  <murrayc murrayc com>
+
+       Gtk::IconInfo: Do not use deprecated copy/free functions.
+
+       * gtk/src/iconinfo.[hg|ccg]: Replace use of deprecated
+       gtk_icon_info_copy()/free() with g_object_ref()/unref.
+       The deprecated functions just call them anyway.
+
+       This partly fixes the build with --enable-warnings=fatal
+
 2013-02-09  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
        Gdk::Rectangle: Add Gdk::join() and Gdk::intersect() nonmember functions.
diff --git a/gtk/src/iconinfo.ccg b/gtk/src/iconinfo.ccg
index a7dc5fc..efad128 100644
--- a/gtk/src/iconinfo.ccg
+++ b/gtk/src/iconinfo.ccg
@@ -20,6 +20,18 @@
 #include <gtk/gtk.h>
 #include <gtkmm/icontheme.h>
 
+namespace {
+
+//This is just to satisfy our generated code, which cannot
+//handle just using g_object_ref() because it needs a cast.
+static GtkIconInfo* gtk_icon_info_ref(GtkIconInfo* icon_info)
+{
+  g_object_ref (G_OBJECT(icon_info));
+  return icon_info;
+}
+
+}
+
 namespace Gtk
 {
 
diff --git a/gtk/src/iconinfo.hg b/gtk/src/iconinfo.hg
index d80cd25..52aaedf 100644
--- a/gtk/src/iconinfo.hg
+++ b/gtk/src/iconinfo.hg
@@ -34,8 +34,8 @@ class IconTheme;
 
 class IconInfo
 {
-  _CLASS_BOXEDTYPE(IconInfo, GtkIconInfo, NONE, gtk_icon_info_copy, gtk_icon_info_free)
-  _IGNORE(gtk_icon_info_get_attach_points, gtk_icon_info_copy, gtk_icon_info_free)
+  _CLASS_BOXEDTYPE(IconInfo, GtkIconInfo, NONE, gtk_icon_info_ref, g_object_unref)
+  _IGNORE(gtk_icon_info_get_attach_points, g_object_ref, g_object_unref, gtk_icon_info_copy, 
gtk_icon_info_free)
 public:
 
   IconInfo(const Glib::RefPtr<IconTheme>& icon_theme, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);


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