glibmm r530 - in trunk: . glib/glibmm



Author: murrayc
Date: Sun Jan 20 18:54:44 2008
New Revision: 530
URL: http://svn.gnome.org/viewvc/glibmm?rev=530&view=rev

Log:
2008-01-20  Murray Cumming  <murrayc murrayc com>

        * glib/glibmm/objectbase.cc:
        * glib/glibmm/objectbase.h: Added connect_property_changed_with_return() 
        because onnect_property_changed() doesn not return a sigc::connection.
        Bug #433984 (Philip Langdale, Kalle Vahlman).


Modified:
   trunk/ChangeLog
   trunk/glib/glibmm/objectbase.cc
   trunk/glib/glibmm/objectbase.h

Modified: trunk/glib/glibmm/objectbase.cc
==============================================================================
--- trunk/glib/glibmm/objectbase.cc	(original)
+++ trunk/glib/glibmm/objectbase.cc	Sun Jan 20 18:54:44 2008
@@ -258,6 +258,11 @@
 
 void ObjectBase::connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot)
 {
+  connect_property_changed_with_return(property_name, slot);
+}
+
+sigc::connection ObjectBase::connect_property_changed_with_return(const Glib::ustring& property_name, const sigc::slot<void>& slot)
+{
   // Create a proxy to hold our connection info
   // This will be deleted by destroy_notify_handler.
   PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode(slot, gobj());
@@ -271,9 +276,12 @@
          notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode, 
          &PropertyProxyConnectionNode::destroy_notify_handler,
          G_CONNECT_AFTER);
+
+  return sigc::connection(pConnectionNode->slot_);
 }
 
 
+
 bool _gobject_cppinstance_already_deleted(GObject* gobject)
 {
   //This function is used to prevent calling wrap() on a GTK+ instance whose gtkmm instance has been deleted.

Modified: trunk/glib/glibmm/objectbase.h
==============================================================================
--- trunk/glib/glibmm/objectbase.h	(original)
+++ trunk/glib/glibmm/objectbase.h	Sun Jan 20 18:54:44 2008
@@ -112,9 +112,19 @@
 
   /** You can use the signal_changed() signal of the property proxy instead, 
    * but this is necessary when using the reduced API.
+   *
+   * See also connect_property_changed_with_return().
    */
   void connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot);
 
+  /** You can use the signal_changed() signal of the property proxy instead, 
+   * but this is necessary when using the reduced API.
+   *
+   * This method was added because connect_property_changed() does not return a sigc::connection, 
+   * and we could not break the ABI by changing that function.
+   */
+  sigc::connection connect_property_changed_with_return(const Glib::ustring& property_name, const sigc::slot<void>& slot);
+
   //TODO: Why are these virtual?
   /** Increment the reference count for this object.
    * You should never need to do this manually - use the object via a RefPtr instead.



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