[ekiga] Made the IFF api a little simpler



commit 133eacdb1a5531158991085de396c8a734ba5ec1
Author: Julien Puydt <jpuydt gnome org>
Date:   Thu Jul 2 14:50:52 2009 +0200

    Made the IFF api a little simpler
    
    - Ekiga::FriendOrFoe::FriendOrFoeHelper was a little
    too much ;
    - an helper should only be *virtual* GmRefCounted, or
    inheritance will be difficult ;
    - finally, there was no need to make the destructor *pure*
    virtual!

 lib/engine/friend-or-foe/friend-or-foe.cpp |    2 +-
 lib/engine/friend-or-foe/friend-or-foe.h   |    9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/friend-or-foe/friend-or-foe.cpp b/lib/engine/friend-or-foe/friend-or-foe.cpp
index 46d75c2..b0b75b9 100644
--- a/lib/engine/friend-or-foe/friend-or-foe.cpp
+++ b/lib/engine/friend-or-foe/friend-or-foe.cpp
@@ -20,7 +20,7 @@ Ekiga::FriendOrFoe::decide (const std::string domain,
 }
 
 void
-Ekiga::FriendOrFoe::add_helper (gmref_ptr<Ekiga::FriendOrFoe::FriendOrFoeHelper> helper)
+Ekiga::FriendOrFoe::add_helper (gmref_ptr<Ekiga::FriendOrFoe::Helper> helper)
 {
   helpers.push_front (helper);
 }
diff --git a/lib/engine/friend-or-foe/friend-or-foe.h b/lib/engine/friend-or-foe/friend-or-foe.h
index c03b754..fd8bb7b 100644
--- a/lib/engine/friend-or-foe/friend-or-foe.h
+++ b/lib/engine/friend-or-foe/friend-or-foe.h
@@ -63,10 +63,11 @@ namespace Ekiga
     /* beware of the order : we prefer erring on the side of safety */
     typedef enum { Unknown, Foe, Neutral, Friend } Identification;
 
-    class FriendOrFoeHelper: public GmRefCounted
+    class Helper: public virtual GmRefCounted
     {
     public:
-      virtual ~FriendOrFoeHelper () = 0;
+      virtual ~Helper ()
+      {}
 
       virtual Identification decide (const std::string domain,
 				     const std::string token) const = 0;
@@ -75,7 +76,7 @@ namespace Ekiga
     Identification decide (const std::string domain,
 			   const std::string token) const;
 
-    void add_helper (gmref_ptr<FriendOrFoeHelper> helper);
+    void add_helper (gmref_ptr<Helper> helper);
 
     /* this turns us into a service */
     const std::string get_name () const
@@ -85,7 +86,7 @@ namespace Ekiga
     { return "\tObject helping determine if an incoming call is acceptable"; }
 
   private:
-    typedef std::list<gmref_ptr<FriendOrFoeHelper> > helpers_type;
+    typedef std::list<gmref_ptr<Helper> > helpers_type;
     helpers_type helpers;
   };
 };



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