ekiga r7241 - in trunk: lib/engine/addressbook/skel lib/engine/presence/local-roster src/endpoints



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

Log:
Use gmref_ptr for the contact decorators

Modified:
   trunk/lib/engine/addressbook/skel/contact-core.cpp
   trunk/lib/engine/addressbook/skel/contact-core.h
   trunk/lib/engine/presence/local-roster/local-roster-bridge.cpp
   trunk/src/endpoints/opal-main.cpp

Modified: trunk/lib/engine/addressbook/skel/contact-core.cpp
==============================================================================
--- trunk/lib/engine/addressbook/skel/contact-core.cpp	(original)
+++ trunk/lib/engine/addressbook/skel/contact-core.cpp	Thu Oct 16 18:33:13 2008
@@ -147,9 +147,9 @@
 
 
 void
-Ekiga::ContactCore::add_contact_decorator (ContactDecorator &decorator)
+Ekiga::ContactCore::add_contact_decorator (gmref_ptr<ContactDecorator> decorator)
 {
-  contact_decorators.push_back (&decorator);
+  contact_decorators.push_back (decorator);
 }
 
 
@@ -160,10 +160,10 @@
 {
   bool populated = false;
 
-  for (std::list<ContactDecorator *>::const_iterator iter
+  for (std::list<gmref_ptr<ContactDecorator> >::const_iterator iter
 	 = contact_decorators.begin ();
        iter != contact_decorators.end ();
-       iter++) {
+       ++iter) {
 
     populated = (*iter)->populate_menu (contact, uri, builder) || populated;
   }

Modified: trunk/lib/engine/addressbook/skel/contact-core.h
==============================================================================
--- trunk/lib/engine/addressbook/skel/contact-core.h	(original)
+++ trunk/lib/engine/addressbook/skel/contact-core.h	Thu Oct 16 18:33:13 2008
@@ -48,7 +48,7 @@
  * @{
  */
 
-  class ContactDecorator
+  class ContactDecorator: public virtual GmRefCounted
   {
   public:
 
@@ -162,7 +162,7 @@
 
   public:
 
-    void add_contact_decorator (ContactDecorator &decorator);
+    void add_contact_decorator (gmref_ptr<ContactDecorator> decorator);
 
     /** Create the menu for a given Contact and its actions.
      * @param The Ekiga::Contact for which the actions could be made available.
@@ -175,7 +175,7 @@
 
   private:
 
-    std::list<ContactDecorator *> contact_decorators;
+    std::list<gmref_ptr<ContactDecorator> > contact_decorators;
 
 
     /*** Misc ***/

Modified: trunk/lib/engine/presence/local-roster/local-roster-bridge.cpp
==============================================================================
--- trunk/lib/engine/presence/local-roster/local-roster-bridge.cpp	(original)
+++ trunk/lib/engine/presence/local-roster/local-roster-bridge.cpp	Thu Oct 16 18:33:13 2008
@@ -118,7 +118,7 @@
     gmref_ptr<Local::ContactDecorator> decorator
       = new Local::ContactDecorator (*cluster);
     core.add (decorator);
-    contact_core->add_contact_decorator (*decorator);
+    contact_core->add_contact_decorator (decorator);
     result = true;
   }
 

Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp	(original)
+++ trunk/src/endpoints/opal-main.cpp	Thu Oct 16 18:33:13 2008
@@ -128,10 +128,10 @@
   if (contact_core) { 
 
 #ifdef HAVE_SIP
-    contact_core->add_contact_decorator (*sip_manager);
+    contact_core->add_contact_decorator (sip_manager);
 #endif
 #ifdef HAVE_H323
-    contact_core->add_contact_decorator (*h323_manager);
+    contact_core->add_contact_decorator (h323_manager);
 #endif
   }
   else



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