[ekiga/ds-gtk-application] Actor: Made register_actions purely virtual.



commit d0121a69995ad343058d9aadae668c3f0a5b2bd0
Author: Damien Sandras <dsandras beip be>
Date:   Sun Mar 16 15:17:37 2014 +0100

    Actor: Made register_actions purely virtual.
    
    This ensures Actor implementations will have to implement it. Even if
    empty.

 lib/engine/addressbook/contact-core.cpp |    8 ++++++++
 lib/engine/addressbook/contact-core.h   |    2 ++
 lib/engine/framework/actor.cpp          |    7 -------
 lib/engine/framework/actor.h            |    3 ++-
 4 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/addressbook/contact-core.cpp b/lib/engine/addressbook/contact-core.cpp
index 1c8eb22..e62a872 100644
--- a/lib/engine/addressbook/contact-core.cpp
+++ b/lib/engine/addressbook/contact-core.cpp
@@ -117,3 +117,11 @@ Ekiga::ContactCore::populate_contact_menu (ContactPtr contact,
 
   return populated;
 }
+
+
+void
+Ekiga::ContactCore::register_actions ()
+{
+  // We have nothing to do. Other Core's will add their own contact actions
+  // to us.
+}
diff --git a/lib/engine/addressbook/contact-core.h b/lib/engine/addressbook/contact-core.h
index 7de0115..02f84ba 100644
--- a/lib/engine/addressbook/contact-core.h
+++ b/lib/engine/addressbook/contact-core.h
@@ -171,6 +171,8 @@ namespace Ekiga
 
   private:
 
+    void register_actions ();
+
     std::list<boost::shared_ptr<ContactDecorator> > contact_decorators;
 
     /*** Misc stuff ***/
diff --git a/lib/engine/framework/actor.cpp b/lib/engine/framework/actor.cpp
index 4cf90a7..4b1af8e 100644
--- a/lib/engine/framework/actor.cpp
+++ b/lib/engine/framework/actor.cpp
@@ -45,10 +45,3 @@ Actor::add_action (ActionPtr action)
 {
   actions.insert (std::make_pair (action->get_name (), action));
 }
-
-
-void
-Actor::register_actions ()
-{
-  // Nothing to do here yet.
-}
diff --git a/lib/engine/framework/actor.h b/lib/engine/framework/actor.h
index de9e186..3a21d3b 100644
--- a/lib/engine/framework/actor.h
+++ b/lib/engine/framework/actor.h
@@ -60,6 +60,7 @@ namespace Ekiga {
 
   public:
 
+
     /** Register an action on the given Actor.
      *
      * Actions that are not "added" using this method will not be usable
@@ -74,7 +75,7 @@ namespace Ekiga {
 
     /** This method must be called by each Actor to register Actions.
      */
-    virtual void register_actions ();
+    virtual void register_actions () = 0;
 
     ActionMap actions;
   };


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