[glibmm/glibmm-3maybe] Remove more deprecated API.



commit 5dd015a69a7c76abd5f8e5676f5f34527a8ad5ff
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jun 8 17:01:31 2010 +0200

    Remove more deprecated API.
    
    * glib/glibmm/objectbase.[h|cc]:
        Remove connect_property_changed_with_return(), adding the return value to
        connect_property_changed().
    * glib/glibmm/refptr.h: Removed deprecated clear() method.

 ChangeLog                 |    9 +++++++++
 glib/glibmm/objectbase.cc |   11 +++--------
 glib/glibmm/objectbase.h  |   28 ++++++++--------------------
 glib/glibmm/refptr.h      |   20 +++-----------------
 4 files changed, 23 insertions(+), 45 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6cf54a6..f4952d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-06-08  Murray Cumming  <murrayc murrayc com>
 
+	Remove more deprecated API.
+
+	* glib/glibmm/objectbase.[h|cc]:
+    Remove connect_property_changed_with_return(), adding the return value to
+    connect_property_changed().
+	* glib/glibmm/refptr.h: Removed deprecated clear() method.
+
+2010-06-08  Murray Cumming  <murrayc murrayc com>
+
 	Add default signal handlers that couldn't be added before breaking ABI.
 
 	* gio/src/drive.hg:
diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc
index 87e9e0b..36ababe 100644
--- a/glib/glibmm/objectbase.cc
+++ b/glib/glibmm/objectbase.cc
@@ -254,24 +254,20 @@ void ObjectBase::get_property_value(const Glib::ustring& property_name, Glib::Va
   g_object_get_property(const_cast<GObject*>(gobj()), property_name.c_str(), value.gobj());
 }
 
-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)
+sigc::connection ObjectBase::connect_property_changed(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());
 
-  // connect it to gtk+
+  // connect it to the C:
   // pConnectionNode will be passed as the data argument to the callback.
   // The callback will then call the virtual Object::property_change_notify() method,
   // which will contain a switch/case statement which will examine the property name.
   const Glib::ustring notify_signal_name = "notify::" + property_name;
   pConnectionNode->connection_id_ = g_signal_connect_data(gobj(),
-         notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode, 
+         notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode,
          &PropertyProxyConnectionNode::destroy_notify_handler,
          G_CONNECT_AFTER);
 
@@ -302,4 +298,3 @@ bool _gobject_cppinstance_already_deleted(GObject* gobject)
 
 
 } // namespace Glib
-
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h
index 69b7722..c950242 100644
--- a/glib/glibmm/objectbase.h
+++ b/glib/glibmm/objectbase.h
@@ -55,7 +55,7 @@ protected:
   /** This default constructor is called implicitly from the constructor of user-derived
    * classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
    * This is normal behaviour for C++ virtual inheritance.
-   * 
+   *
    * The GType name will be gtkmm__anonymous_custom_type.
    */
   ObjectBase();
@@ -63,7 +63,7 @@ protected:
   /** A derived constructor always overrides this choice.
    * The C++ language itself ensures that the constructor
    * is only invoked once.
-   * 
+   *
    * All classes generated by gtkmmproc use this constructor, with custom_type_name = 0,
    * which essentially means it's not a custom type.  This is used to optimize
    * vfunc and signal handler callbacks -- since the C++ virtual methods are
@@ -104,20 +104,10 @@ public:
   template <class PropertyType>
   void get_property(const Glib::ustring& property_name, PropertyType& value) const;
 
-  /** 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().
+  /** Receive notifications of changes of named property values.
+   * You can use the signal_changed() signal of the property proxy instead.
    */
-  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);
+  sigc::connection connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot);
 
   /** Increases the freeze count on object. If the freeze count is non-zero, the
    * emission of "notify" signals on object is stopped. The signals are queued
@@ -128,7 +118,7 @@ public:
    */
   void freeze_notify();
 
-  /** 
+  /**
    * Reverts the effect of a previous call to freeze_notify(). The freeze count
    * is decreased on object and when it reaches zero, all queued "notify"
    * signals are emitted.
@@ -137,16 +127,15 @@ public:
    */
   void thaw_notify();
 
-  //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.
    */
-  virtual void reference() const;
+  void reference() const;
 
   /** Decrement the reference count for this object.
    * You should never need to do this manually - use the object via a RefPtr instead.
    */
-  virtual void unreference() const;
+  void unreference() const;
 
   ///Provides access to the underlying C GObject.
   inline GObject*       gobj()       { return gobject_; }
@@ -254,4 +243,3 @@ bool _gobject_cppinstance_already_deleted(GObject* gobject);
 
 
 #endif /* _GLIBMM_OBJECTBASE_H */
-
diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h
index b262edd..1562302 100644
--- a/glib/glibmm/refptr.h
+++ b/glib/glibmm/refptr.h
@@ -55,7 +55,7 @@ public:
    * Afterwards it will be null and use of -> will cause a segmentation fault.
    */
   inline RefPtr();
-  
+
   /// Destructor - decrements reference count.
   inline ~RefPtr();
 
@@ -94,7 +94,7 @@ public:
 
   /// Tests whether the RefPtr<> point to the same underlying instance.
   inline bool operator==(const RefPtr<T_CppObject>& src) const;
-  
+
   /// See operator==().
   inline bool operator!=(const RefPtr<T_CppObject>& src) const;
 
@@ -115,11 +115,6 @@ public:
    */
   inline operator bool() const;
 
-#ifndef GLIBMM_DISABLE_DEPRECATED
-  /// @deprecated Use reset() instead because this leads to confusion with clear() methods on the underlying class. For instance, people use .clear() when they mean ->clear().
-  inline void clear();
-#endif //GLIBMM_DISABLE_DEPRECATED
-
   /** Set underlying instance to 0, decrementing reference count of existing instance appropriately.
    * @newin{2,16}
    */
@@ -137,7 +132,7 @@ public:
 
   /** Static cast to derived class.
    *
-   * Like the dynamic cast; the notation is 
+   * Like the dynamic cast; the notation is
    * @code
    *   ptr_derived = RefPtr<Derived>::cast_static(ptr_base);
    * @endcode
@@ -284,14 +279,6 @@ RefPtr<T_CppObject>::operator bool() const
   return (pCppObject_ != 0);
 }
 
-#ifndef GLIBMM_DISABLE_DEPRECATED
-template <class T_CppObject> inline
-void RefPtr<T_CppObject>::clear()
-{
-  reset();
-}
-#endif //GLIBMM_DISABLE_DEPRECATED
-
 template <class T_CppObject> inline
 void RefPtr<T_CppObject>::reset()
 {
@@ -351,4 +338,3 @@ void swap(RefPtr<T_CppObject>& lhs, RefPtr<T_CppObject>& rhs)
 
 
 #endif /* _GLIBMM_REFPTR_H */
-



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