ekiga r7236 - in trunk: lib/engine/presence/skel src/endpoints



Author: jpuydt
Date: Thu Oct 16 13:44:25 2008
New Revision: 7236
URL: http://svn.gnome.org/viewvc/ekiga?rev=7236&view=rev

Log:
Use gmref_ptr for the presentity decorators (and remove unused api)

Modified:
   trunk/lib/engine/presence/skel/presence-core.cpp
   trunk/lib/engine/presence/skel/presence-core.h
   trunk/src/endpoints/opal-main.cpp

Modified: trunk/lib/engine/presence/skel/presence-core.cpp
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.cpp	(original)
+++ trunk/lib/engine/presence/skel/presence-core.cpp	Thu Oct 16 13:44:25 2008
@@ -137,15 +137,9 @@
 }
 
 void
-Ekiga::PresenceCore::add_presentity_decorator (PresentityDecorator &decorator)
+Ekiga::PresenceCore::add_presentity_decorator (gmref_ptr<PresentityDecorator> decorator)
 {
-  presentity_decorators.push_back (&decorator);
-}
-
-void
-Ekiga::PresenceCore::remove_presentity_decorator (PresentityDecorator& decorator)
-{
-  presentity_decorators.remove (&decorator);
+  presentity_decorators.push_back (decorator);
 }
 
 bool
@@ -155,10 +149,10 @@
 {
   bool populated = false;
 
-  for (std::list<PresentityDecorator *>::const_iterator iter
+  for (std::list<gmref_ptr<PresentityDecorator> >::const_iterator iter
 	 = presentity_decorators.begin ();
        iter != presentity_decorators.end ();
-       iter++) {
+       ++iter) {
 
     populated = (*iter)->populate_menu (presentity, uri, builder) || populated;
   }

Modified: trunk/lib/engine/presence/skel/presence-core.h
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.h	(original)
+++ trunk/lib/engine/presence/skel/presence-core.h	Thu Oct 16 13:44:25 2008
@@ -52,7 +52,7 @@
  */
 
 
-  class PresentityDecorator
+  class PresentityDecorator: public GmRefCounted
   {
   public:
 
@@ -219,12 +219,7 @@
     /** Adds a decorator to the pool of presentity decorators.
      * @param The presentity decorator.
      */
-    void add_presentity_decorator (PresentityDecorator &decorator);
-
-    /** Removes a decorator from the pool of presentity decorators.
-     * @param The presentity decorator.
-     */
-    void remove_presentity_decorator (PresentityDecorator& decorator);
+    void add_presentity_decorator (gmref_ptr<PresentityDecorator> decorator);
 
     /** Populates a menu with the actions available on a given uri.
      * @param The uri for which the decoration is needed.
@@ -236,7 +231,7 @@
 
   private:
 
-    std::list<PresentityDecorator*> presentity_decorators;
+    std::list<gmref_ptr<PresentityDecorator> > presentity_decorators;
 
     /*** API to help presentities get presence ***/
   public:

Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp	(original)
+++ trunk/src/endpoints/opal-main.cpp	Thu Oct 16 13:44:25 2008
@@ -106,14 +106,14 @@
 
 #ifdef HAVE_SIP
   unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
-  Sip::EndPoint *sip_manager = new Sip::EndPoint (*call_manager, core, sip_port);
+  gmref_ptr<Sip::EndPoint> sip_manager = new Sip::EndPoint (*call_manager, core, sip_port);
   call_manager->add_protocol_manager (*sip_manager);
   account_core->add_account_subscriber (*sip_manager);
 #endif
 
 #ifdef HAVE_H323
   unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");
-  H323::EndPoint *h323_manager = new H323::EndPoint (*call_manager, core, h323_port);
+  gmref_ptr<H323::EndPoint> h323_manager = new H323::EndPoint (*call_manager, core, h323_port);
   call_manager->add_protocol_manager (*h323_manager);
   account_core->add_account_subscriber (*h323_manager);
 #endif
@@ -140,12 +140,12 @@
   if (presence_core) {
 
 #ifdef HAVE_SIP
-    presence_core->add_presentity_decorator (*sip_manager);
+    presence_core->add_presentity_decorator (sip_manager);
     presence_core->add_presence_fetcher (*sip_manager);
     presence_core->add_presence_publisher (*sip_manager);
 #endif
 #ifdef HAVE_H323
-    presence_core->add_presentity_decorator (*h323_manager);
+    presence_core->add_presentity_decorator (h323_manager);
 #endif
     presence_core->add_supported_uri (sigc::ptr_fun (is_supported_address)); //FIXME
   }



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