[ekiga/ds-gtk-application] Engine&Plugins: Removed populate_* methods.



commit 4a66b09159f86f071e452bd25133dad3a550e140
Author: Damien Sandras <dsandras seconix com>
Date:   Sun Dec 14 17:18:44 2014 +0100

    Engine&Plugins: Removed populate_* methods.
    
    Most of the code has been moved to the new Actor framework. They are
    thus useless.
    
    ContactDecorator/PresentityDecorator code has been consequently removed
    too.

 lib/engine/account/account-core.cpp                |   16 -----
 lib/engine/account/account-core.h                  |    6 --
 lib/engine/account/bank.h                          |    8 ---
 lib/engine/addressbook/contact-core.cpp            |   44 ---------------
 lib/engine/addressbook/contact-core.h              |   37 ------------
 .../components/call-history/history-contact.cpp    |   11 ----
 .../components/call-history/history-contact.h      |    3 -
 lib/engine/components/opal/opal-account.cpp        |   59 --------------------
 lib/engine/components/opal/opal-account.h          |    5 --
 lib/engine/components/opal/opal-bank.cpp           |   31 ----------
 lib/engine/components/opal/opal-bank.h             |   13 ----
 lib/engine/components/opal/opal-main.cpp           |    3 +-
 lib/engine/components/opal/opal-presentity.cpp     |    7 --
 lib/engine/components/opal/opal-presentity.h       |    2 -
 lib/engine/framework/live-object.h                 |    5 --
 lib/engine/gui/gtk-frontend/book-view-gtk.cpp      |   32 -----------
 lib/engine/gui/gtk-frontend/book-view-gtk.h        |    2 -
 lib/engine/gui/gtk-frontend/presentity-view.cpp    |   33 -----------
 lib/engine/gui/gtk-frontend/roster-view-gtk.cpp    |   12 ----
 lib/engine/presence/heap.h                         |    8 ---
 lib/engine/presence/presence-core.cpp              |   38 -------------
 lib/engine/presence/presence-core.h                |   44 +--------------
 lib/engine/presence/uri-presentity.cpp             |   11 ----
 plugins/evolution/evolution-contact.cpp            |   40 -------------
 plugins/evolution/evolution-contact.h              |    2 -
 plugins/ldap/ldap-contact.cpp                      |   25 --------
 plugins/ldap/ldap-contact.h                        |    2 -
 27 files changed, 2 insertions(+), 497 deletions(-)
---
diff --git a/lib/engine/account/account-core.cpp b/lib/engine/account/account-core.cpp
index 4722e8f..faec602 100644
--- a/lib/engine/account/account-core.cpp
+++ b/lib/engine/account/account-core.cpp
@@ -46,22 +46,6 @@ Ekiga::AccountCore::~AccountCore ()
 }
 
 
-bool
-Ekiga::AccountCore::populate_menu (MenuBuilder & builder)
-{
-  bool populated = false;
-
-  for (bank_const_iterator iter = banks.begin ();
-       iter != banks.end ();
-       iter++) {
-
-    populated = (*iter)->populate_menu (builder);
-  }
-
-  return populated;
-}
-
-
 void
 Ekiga::AccountCore::add_bank (BankPtr bank)
 {
diff --git a/lib/engine/account/account-core.h b/lib/engine/account/account-core.h
index 1b7454f..ea0d1ab 100644
--- a/lib/engine/account/account-core.h
+++ b/lib/engine/account/account-core.h
@@ -138,12 +138,6 @@ namespace Ekiga
 
   public:
 
-    /** Create the menu for the AccountCore and its actions.
-     * @param A MenuBuilder object to populate.
-     */
-    bool populate_menu (MenuBuilder &builder);
-
-
     /** This signal is emitted when the AccountCore Service has been
      * updated.
      */
diff --git a/lib/engine/account/bank.h b/lib/engine/account/bank.h
index b0ee329..44221ab 100644
--- a/lib/engine/account/bank.h
+++ b/lib/engine/account/bank.h
@@ -66,14 +66,6 @@ namespace Ekiga
     virtual void visit_accounts (boost::function1<bool, AccountPtr> visitor) const = 0;
 
 
-    /** Create the menu for that Bank and its actions.
-     * This function is purely virtual and should be implemented by
-     * the descendant of the Ekiga::Bank.
-     * @param A MenuBuilder object to populate.
-     */
-    virtual bool populate_menu (MenuBuilder &) = 0;
-
-
     /** This signal is emitted when a account has been added.
      */
     boost::signals2::signal<void(AccountPtr)> account_added;
diff --git a/lib/engine/addressbook/contact-core.cpp b/lib/engine/addressbook/contact-core.cpp
index a7563f6..aaacae0 100644
--- a/lib/engine/addressbook/contact-core.cpp
+++ b/lib/engine/addressbook/contact-core.cpp
@@ -45,26 +45,6 @@ on_search ()
 }
 */
 
-bool
-Ekiga::ContactCore::populate_menu (MenuBuilder &builder)
-{
-  bool populated = false;
-
-  //builder.add_action ("search", _("_Find"), &on_search);
-  //populated = true;
-
-  for (std::list<SourcePtr >::const_iterator iter = sources.begin ();
-       iter != sources.end ();
-       ++iter) {
-
-    if (populated)
-      builder.add_separator ();
-    populated = (*iter)->populate_menu (builder);
-  }
-
-  return populated;
-}
-
 
 void
 Ekiga::ContactCore::add_source (SourcePtr source)
@@ -93,27 +73,3 @@ Ekiga::ContactCore::visit_sources (boost::function1<bool, SourcePtr > visitor) c
        ++iter)
     go_on = visitor (*iter);
 }
-
-void
-Ekiga::ContactCore::add_contact_decorator (boost::shared_ptr<ContactDecorator> decorator)
-{
-  contact_decorators.push_back (decorator);
-}
-
-bool
-Ekiga::ContactCore::populate_contact_menu (ContactPtr _contact,
-                                          const std::string _uri,
-                                          MenuBuilder &builder)
-{
-  bool populated = false;
-
-  for (std::list<boost::shared_ptr<ContactDecorator> >::const_iterator iter
-        = contact_decorators.begin ();
-       iter != contact_decorators.end ();
-       ++iter) {
-
-    populated = (*iter)->populate_menu (_contact, _uri, builder) || populated;
-  }
-
-  return populated;
-}
diff --git a/lib/engine/addressbook/contact-core.h b/lib/engine/addressbook/contact-core.h
index 6ca3dd0..0d9345a 100644
--- a/lib/engine/addressbook/contact-core.h
+++ b/lib/engine/addressbook/contact-core.h
@@ -50,18 +50,6 @@ namespace Ekiga
  * @{
  */
 
-  class ContactDecorator
-  {
-  public:
-
-    virtual ~ContactDecorator ()
-    {}
-
-    virtual bool populate_menu (ContactPtr /*contact*/,
-                               const std::string /*uri*/,
-                               MenuBuilder& /*builder*/) = 0;
-  };
-
 
   /** Core object for address book support.
    *
@@ -97,10 +85,6 @@ namespace Ekiga
     { return "\tContact managing object"; }
 
 
-    /*** LiveObject implementation ***/
-    bool populate_menu (MenuBuilder& builder);
-
-
     /*** Public API ***/
 
     /** Adds a source to the ContactCore service.
@@ -155,27 +139,6 @@ namespace Ekiga
   private:
 
     std::list<SourcePtr > sources;
-
-    /*** Contact Helpers ***/
-
-  public:
-
-    void add_contact_decorator (boost::shared_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.
-     * @param The uri for which actions could be made available.
-     * @param A MenuBuilder object to populate.
-     */
-    bool populate_contact_menu (ContactPtr contact,
-                               const std::string uri,
-                                MenuBuilder &builder);
-
-  private:
-
-    std::list<boost::shared_ptr<ContactDecorator> > contact_decorators;
-
-    /*** Misc stuff ***/
     Ekiga::scoped_connections conns;
   };
 
diff --git a/lib/engine/components/call-history/history-contact.cpp 
b/lib/engine/components/call-history/history-contact.cpp
index 0e76b2a..f5866ca 100644
--- a/lib/engine/components/call-history/history-contact.cpp
+++ b/lib/engine/components/call-history/history-contact.cpp
@@ -192,17 +192,6 @@ History::Contact::get_groups () const
   return groups;
 }
 
-bool
-History::Contact::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  boost::shared_ptr<Ekiga::ContactCore> ccore = contact_core.lock ();
-  if (ccore)
-    return ccore->populate_contact_menu (ContactPtr (this, null_deleter ()),
-                                        uri, builder);
-  else
-    return false;
-}
-
 xmlNodePtr
 History::Contact::get_node ()
 {
diff --git a/lib/engine/components/call-history/history-contact.h 
b/lib/engine/components/call-history/history-contact.h
index c4dffaa..5df3feb 100644
--- a/lib/engine/components/call-history/history-contact.h
+++ b/lib/engine/components/call-history/history-contact.h
@@ -87,11 +87,8 @@ namespace History
 
     const std::set<std::string> get_groups () const;
 
-    bool populate_menu (Ekiga::MenuBuilder &builder);
-
 
     /*** more specific api ***/
-
     xmlNodePtr get_node ();
 
     call_type get_type () const;
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 0f0e52a..1104491 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -575,57 +575,6 @@ Opal::Account::remove ()
 }
 
 
-bool
-Opal::Account::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  if (is_enabled ())
-    builder.add_action ("user-offline", _("_Disable"),
-                        boost::bind (&Opal::Account::disable, this));
-  else
-    builder.add_action ("user-available", _("_Enable"),
-                        boost::bind (&Opal::Account::enable, this));
-
-  builder.add_separator ();
-
-  builder.add_action ("add", _("A_dd Contact"),
-                     boost::bind (&Opal::Account::add_contact, this));
-  
-  builder.add_separator ();
-
-  builder.add_action ("edit", _("_Edit"),
-                     boost::bind (&Opal::Account::edit, this));
-  builder.add_action ("remove", _("_Remove"),
-                     boost::bind (&Opal::Account::remove, this));
-
-  if (type == DiamondCard) {
-
-    std::stringstream str;
-    std::stringstream url;
-    str << "https://www.diamondcard.us/exec/voip-login?accId="; << get_username () << "&pinCode=" << 
get_password () << "&spo=ekiga";
-
-    builder.add_separator ();
-
-    url.str ("");
-    url << str.str () << "&act=rch";
-    builder.add_action ("recharge",
-                       _("Recharge the account"),
-                        boost::bind (&Opal::Account::on_consult, this, url.str ()));
-    url.str ("");
-    url << str.str () << "&act=bh";
-    builder.add_action ("balance",
-                        _("Consult the balance history"),
-                        boost::bind (&Opal::Account::on_consult, this, url.str ()));
-    url.str ("");
-    url << str.str () << "&act=ch";
-    builder.add_action ("history",
-                        _("Consult the call history"),
-                        boost::bind (&Opal::Account::on_consult, this, url.str ()));
-  }
-
-  return true;
-}
-
-
 void
 Opal::Account::edit ()
 {
@@ -1293,14 +1242,6 @@ Opal::Account::visit_presentities (boost::function1<bool, Ekiga::PresentityPtr >
 }
 
 
-bool
-Opal::Account::populate_menu_for_group (const std::string name,
-                                       Ekiga::MenuBuilder& builder)
-{
-  return false;
-}
-
-
 void
 Opal::Account::on_rename_group (Opal::PresentityPtr pres)
 {
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 37af923..0966903 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -161,8 +161,6 @@ public:
 
     void edit ();
 
-    bool populate_menu (Ekiga::MenuBuilder &builder);
-
     boost::signals2::signal<void(void)> trigger_saving;
 
     /*
@@ -185,9 +183,6 @@ public:
 
     /* This part of the api is the implementation of Ekiga::Heap */
     void visit_presentities (boost::function1<bool, Ekiga::PresentityPtr > visitor) const;
-    bool populate_menu_for_group (const std::string name,
-                                 Ekiga::MenuBuilder& builder);
-
 
     /* This object is not an Ekiga::PresenceFetcher, but Opal::Bank is,
      * this is where the information comes from
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index 0555ada..6215bea 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -138,37 +138,6 @@ Opal::Bank::~Bank ()
 }
 
 
-bool
-Opal::Bank::populate_menu (Ekiga::MenuBuilder & builder)
-{
-
-
-  return true;
-}
-
-
-bool
-Opal::Bank::populate_menu (Ekiga::PresentityPtr presentity,
-                          const std::string uri,
-                          Ekiga::MenuBuilder& builder)
-{
-  return populate_menu_helper (presentity->get_name (), uri, builder);
-}
-
-
-bool
-Opal::Bank::populate_menu_helper (const std::string fullname,
-                                 const std::string& uri,
-                                 Ekiga::MenuBuilder& builder)
-{
-  bool result = false;
-
-  std::cout << "should be fixed" << std::endl << std::flush;
-
-  return result;
-}
-
-
 void
 Opal::Bank::new_account (Account::Type acc_type,
                         std::string username,
diff --git a/lib/engine/components/opal/opal-bank.h b/lib/engine/components/opal/opal-bank.h
index 120854b..36d2637 100644
--- a/lib/engine/components/opal/opal-bank.h
+++ b/lib/engine/components/opal/opal-bank.h
@@ -57,7 +57,6 @@ namespace Opal
       public Ekiga::Cluster,
       public Ekiga::PresencePublisher,
       public Ekiga::PresenceFetcher,
-      public Ekiga::PresentityDecorator,
       public Ekiga::Service
   {
 public:
@@ -66,8 +65,6 @@ public:
 
     ~Bank ();
 
-    bool populate_menu (Ekiga::MenuBuilder & builder);
-
     const std::string get_name () const
     { return "opal-account-store"; }
 
@@ -91,12 +88,6 @@ public:
     void fetch (const std::string) {}
     void unfetch (const std::string) {}
 
-    /*
-     * this object is an Ekiga::ContactDecorator and an Ekiga::PresentityDecorator
-     */
-    bool populate_menu (Ekiga::PresentityPtr presentity,
-                       const std::string uri,
-                       Ekiga::MenuBuilder& builder);
 
     /** Find the account with the given address of record in the Bank
      * @param aor is the address of record of the Account or the host to look
@@ -131,10 +122,6 @@ private:
     boost::shared_ptr<xmlDoc> doc;
     xmlNodePtr node;
 
-    bool populate_menu_helper (const std::string fullname,
-                              const std::string& uri,
-                              Ekiga::MenuBuilder& builder);
-
     bool on_new_account_form_submitted (bool submitted,
                                         Ekiga::Form& form,
                                         std::string& error,
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index 3b89079..ccd7e3c 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -73,7 +73,7 @@ is_supported_address (const std::string uri)
 }
 
 /* FIXME: add here an Ekiga::Service which will add&remove publishers,
- * decorators and fetchers
+ * and fetchers
  */
 
 using namespace Opal;
@@ -122,7 +122,6 @@ struct OPALSpark: public Ekiga::Spark
       account_core->add_bank (bank);
       presence_core->add_cluster (bank);
       core.add (bank);
-      presence_core->add_presentity_decorator (bank);
       call_manager->ready.connect (boost::bind (&Opal::Bank::call_manager_ready, &*bank));
       call_manager->setup ();
       presence_core->add_presence_publisher (bank);
diff --git a/lib/engine/components/opal/opal-presentity.cpp b/lib/engine/components/opal/opal-presentity.cpp
index 0c94a12..99fae55 100644
--- a/lib/engine/components/opal/opal-presentity.cpp
+++ b/lib/engine/components/opal/opal-presentity.cpp
@@ -242,13 +242,6 @@ Opal::Presentity::set_status (const std::string status_)
 }
 
 
-bool
-Opal::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  return true;
-}
-
-
 void
 Opal::Presentity::edit_presentity ()
 {
diff --git a/lib/engine/components/opal/opal-presentity.h b/lib/engine/components/opal/opal-presentity.h
index bdac762..e00a182 100644
--- a/lib/engine/components/opal/opal-presentity.h
+++ b/lib/engine/components/opal/opal-presentity.h
@@ -90,8 +90,6 @@ namespace Opal
 
     bool has_uri (const std::string uri) const;
 
-    bool populate_menu (Ekiga::MenuBuilder &);
-
     /* setter methods specific for this class of presentity, where we
      * expect to get presence from elsewhere:
      */
diff --git a/lib/engine/framework/live-object.h b/lib/engine/framework/live-object.h
index 2e812eb..0ba4212 100644
--- a/lib/engine/framework/live-object.h
+++ b/lib/engine/framework/live-object.h
@@ -50,11 +50,6 @@ namespace Ekiga
 
     virtual ~LiveObject () { }
 
-    /** Populate a menu with the action available on that object
-     * @param A MenuBuilder object to populate.
-     */
-    virtual bool populate_menu (MenuBuilder &) { return false; };
-
 
     /**
      * Signals on that object
diff --git a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
index 1d3c9bf..07fb393 100644
--- a/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/book-view-gtk.cpp
@@ -716,35 +716,3 @@ book_view_gtk_handle_event (BookViewGtk *self,
 
   return FALSE;
 }
-
-
-void
-book_view_gtk_populate_menu (BookViewGtk *self,
-                            GtkWidget *menu)
-{
-  g_return_if_fail (IS_BOOK_VIEW_GTK (self));
-  g_return_if_fail (GTK_IS_MENU (menu));
-
-  GtkTreeSelection *selection = NULL;
-  GtkTreeModel *model = NULL;
-  GtkTreeIter iter;
-  Ekiga::Contact *contact = NULL;
-  GtkWidget *item = NULL;
-  MenuBuilderGtk builder (menu);
-
-  self->priv->book->populate_menu (builder);
-
-  selection = gtk_tree_view_get_selection (self->priv->tree_view);
-
-  if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-
-    gtk_tree_model_get (model, &iter, COLUMN_CONTACT_POINTER, &contact, -1);
-
-    if (contact) {
-
-      item = gtk_separator_menu_item_new ();
-      gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-      contact->populate_menu (builder);
-    }
-  }
-}
diff --git a/lib/engine/gui/gtk-frontend/book-view-gtk.h b/lib/engine/gui/gtk-frontend/book-view-gtk.h
index 4fb6e82..76af114 100644
--- a/lib/engine/gui/gtk-frontend/book-view-gtk.h
+++ b/lib/engine/gui/gtk-frontend/book-view-gtk.h
@@ -61,8 +61,6 @@ GtkWidget *book_view_gtk_new (Ekiga::BookPtr book);
 gboolean book_view_gtk_handle_event (BookViewGtk *self,
                                      GdkEvent *event);
 
-void book_view_gtk_populate_menu (BookViewGtk *, GtkWidget *);
-
 /* GObject thingies */
 
 struct _BookViewGtk
diff --git a/lib/engine/gui/gtk-frontend/presentity-view.cpp b/lib/engine/gui/gtk-frontend/presentity-view.cpp
index 29e5c2f..0a2f153 100644
--- a/lib/engine/gui/gtk-frontend/presentity-view.cpp
+++ b/lib/engine/gui/gtk-frontend/presentity-view.cpp
@@ -61,10 +61,6 @@ static void on_presentity_updated (PresentityView* self);
 
 static void on_presentity_removed (PresentityView* self);
 
-static gboolean on_event_after (GtkWidget* widget,
-                               GdkEventButton* event,
-                               gpointer data);
-
 /* declaration of internal api */
 
 static void presentity_view_set_presentity (PresentityView* self,
@@ -100,33 +96,6 @@ on_presentity_removed (PresentityView* self)
   presentity_view_unset_presentity (self);
 }
 
-static gboolean
-on_event_after (G_GNUC_UNUSED GtkWidget* widget,
-               GdkEventButton* event,
-               gpointer data)
-{
-  gboolean result = FALSE;
-  PresentityView* self = (PresentityView*)data;
-
-  if (self->priv->presentity && event->type == GDK_BUTTON_PRESS && event->button == 3) {
-
-    MenuBuilderGtk builder;
-    self->priv->presentity->populate_menu (builder);
-    if (!builder.empty ()) {
-
-      gtk_widget_show_all (builder.menu);
-      gtk_menu_popup (GTK_MENU (builder.menu), NULL, NULL,
-                     NULL, NULL, event->button, event->time);
-      g_signal_connect (builder.menu, "hide",
-                       G_CALLBACK (g_object_unref),
-                       (gpointer) builder.menu);
-      result = TRUE;
-    }
-    g_object_ref_sink (G_OBJECT (builder.menu));
-  }
-
-  return result;
-}
 
 /* implementation of internal api */
 
@@ -233,8 +202,6 @@ presentity_view_init (PresentityView* self)
   gtk_box_pack_start (GTK_BOX (box), self->priv->name_status,
                      FALSE, FALSE, 2);
   gtk_widget_show (self->priv->name_status);
-
-  g_signal_connect (self, "event-after", G_CALLBACK (on_event_after), self);
 }
 
 /* public api */
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index aaf88f7..4a7721c 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -160,8 +160,6 @@ static void on_clicked_fold (RosterViewGtk* self,
                             GtkTreePath* path,
                             const gchar* name);
 
-static void on_clicked_trigger_presentity (Ekiga::Presentity* presentity);
-
 /* DESCRIPTION : Called whenever a (online/total) count has to be updated
  * BEHAVIOUR   : Updates things...
  * PRE         : Both arguments have to be correct
@@ -545,14 +543,6 @@ on_clicked_fold (RosterViewGtk* self,
 }
 
 static void
-on_clicked_trigger_presentity (Ekiga::Presentity* presentity)
-{
-  Ekiga::TriggerMenuBuilder builder;
-
-  presentity->populate_menu (builder);
-}
-
-static void
 update_offline_count (RosterViewGtk* self,
                      GtkTreeIter* iter)
 {
@@ -800,8 +790,6 @@ on_view_event_after (GtkWidget *tree_view,
       if (event->type == GDK_BUTTON_PRESS && event->button == 3 && self->priv->presentity_menu->get_menu ())
         gtk_menu_popup (GTK_MENU (self->priv->presentity_menu->get_menu ()),
                         NULL, NULL, NULL, NULL, event->button, event->time);
-      else if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_KEY_PRESS)
-        on_clicked_trigger_presentity (presentity);
       break;
     default:
 
diff --git a/lib/engine/presence/heap.h b/lib/engine/presence/heap.h
index 0f2c2ca..97fa947 100644
--- a/lib/engine/presence/heap.h
+++ b/lib/engine/presence/heap.h
@@ -70,14 +70,6 @@ namespace Ekiga
      */
     virtual void visit_presentities (boost::function1<bool, PresentityPtr >) const = 0;
 
-    /** Populates a menu with the actions possible on the given group
-     * of the Heap.
-     * @param The name of the group on which to act.
-     * @param The builder to populate.
-     */
-    virtual bool populate_menu_for_group (const std::string name,
-                                         MenuBuilder&) = 0;
-
     /**
      * Signals on that object
      */
diff --git a/lib/engine/presence/presence-core.cpp b/lib/engine/presence/presence-core.cpp
index dd18993..4fee94e 100644
--- a/lib/engine/presence/presence-core.cpp
+++ b/lib/engine/presence/presence-core.cpp
@@ -71,20 +71,6 @@ Ekiga::PresenceCore::visit_clusters (boost::function1<bool, ClusterPtr > visitor
     go_on = visitor (*iter);
 }
 
-bool
-Ekiga::PresenceCore::populate_menu (MenuBuilder &builder)
-{
-  bool populated = false;
-
-  for (std::set<ClusterPtr >::iterator iter = clusters.begin ();
-       iter != clusters.end ();
-       ++iter)
-    if ((*iter)->populate_menu (builder))
-      populated = true;
-
-  return populated;
-}
-
 void Ekiga::PresenceCore::on_heap_added (HeapPtr heap,
                                         ClusterPtr cluster)
 {
@@ -129,30 +115,6 @@ Ekiga::PresenceCore::on_presentity_removed (HeapPtr heap,
 }
 
 void
-Ekiga::PresenceCore::add_presentity_decorator (boost::shared_ptr<PresentityDecorator> decorator)
-{
-  presentity_decorators.push_back (decorator);
-}
-
-bool
-Ekiga::PresenceCore::populate_presentity_menu (PresentityPtr presentity,
-                                              const std::string uri,
-                                              MenuBuilder &builder)
-{
-  bool populated = false;
-
-  for (std::list<boost::shared_ptr<PresentityDecorator> >::const_iterator iter
-        = presentity_decorators.begin ();
-       iter != presentity_decorators.end ();
-       ++iter) {
-
-    populated = (*iter)->populate_menu (presentity, uri, builder) || populated;
-  }
-
-  return populated;
-}
-
-void
 Ekiga::PresenceCore::add_presence_fetcher (boost::shared_ptr<PresenceFetcher> fetcher)
 {
   presence_fetchers.push_back (fetcher);
diff --git a/lib/engine/presence/presence-core.h b/lib/engine/presence/presence-core.h
index 3c7a7dd..2be941e 100644
--- a/lib/engine/presence/presence-core.h
+++ b/lib/engine/presence/presence-core.h
@@ -52,26 +52,6 @@ namespace Ekiga
  * @defgroup presence Presence
  * @{
  */
-
-
-  class PresentityDecorator
-  {
-  public:
-
-    /** The destructor.
-     */
-    virtual ~PresentityDecorator () {}
-
-    /** Completes the menu for actions available on an uri
-     * @param The presentity for which the action could be made available.
-     * @param The uri for which actions could be made available.
-     * @param A MenuBuilder object to populate.
-     */
-    virtual bool populate_menu (PresentityPtr /*presentity*/,
-                               const std::string /*uri*/,
-                               MenuBuilder &/*builder*/) = 0;
-  };
-
   class PresenceFetcher
   {
   public:
@@ -117,9 +97,7 @@ namespace Ekiga
    *    data, but still be able to gain presence information and actions on
    *    them.
    *
-   * This is achieved by using three types of helpers:
-   *  - the abstract class PresentityDecorator, which allows to enable actions
-   *    on presentities based on uris;
+   * This is achieved by using two types of helpers:
    * - the abstract class PresenceFetcher, through which it is possible to gain
    *   presence information: they allow the PresenceCore to declare some
    *   presence information is needed about an uri, or now unneeded;
@@ -208,26 +186,6 @@ namespace Ekiga
                                PresentityPtr presentity,
                                ClusterPtr cluster);
 
-    /*** API to act on presentities ***/
-  public:
-
-    /** Adds a decorator to the pool of presentity decorators.
-     * @param The presentity decorator.
-     */
-    void add_presentity_decorator (boost::shared_ptr<PresentityDecorator> decorator);
-
-    /** Populates a menu with the actions available on a given uri.
-     * @param The uri for which the decoration is needed.
-     * @param The builder to populate.
-     */
-    bool populate_presentity_menu (PresentityPtr presentity,
-                                  const std::string uri,
-                                  MenuBuilder &builder);
-
-  private:
-
-    std::list<boost::shared_ptr<PresentityDecorator> > presentity_decorators;
-
     /*** API to help presentities get presence ***/
   public:
 
diff --git a/lib/engine/presence/uri-presentity.cpp b/lib/engine/presence/uri-presentity.cpp
index 17986e3..7b14947 100644
--- a/lib/engine/presence/uri-presentity.cpp
+++ b/lib/engine/presence/uri-presentity.cpp
@@ -99,17 +99,6 @@ Ekiga::URIPresentity::has_uri (const std::string uri_) const
   return uri == uri_;
 }
 
-bool
-Ekiga::URIPresentity::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock ();
-  if (pcore)
-    return pcore->populate_presentity_menu (PresentityPtr(this, null_deleter ()),
-                                           uri, builder);
-  else
-    return false;
-}
-
 void
 Ekiga::URIPresentity::on_presence_received (std::string uri_,
                                            std::string presence_)
diff --git a/plugins/evolution/evolution-contact.cpp b/plugins/evolution/evolution-contact.cpp
index f102f5a..69a0f7f 100644
--- a/plugins/evolution/evolution-contact.cpp
+++ b/plugins/evolution/evolution-contact.cpp
@@ -213,46 +213,6 @@ Evolution::Contact::remove ()
   e_book_remove_contact (book, get_id().c_str (), NULL);
 }
 
-bool
-Evolution::Contact::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  boost::shared_ptr<Ekiga::ContactCore> core = services.get<Ekiga::ContactCore> ("contact-core");
-  bool populated = false;
-  std::map<std::string, std::string> uris;
-
-  if (core) {
-
-    Ekiga::TemporaryMenuBuilder tmp_builder;
-
-    for (unsigned int attr_type = 0; attr_type < ATTR_NUMBER; attr_type++) {
-
-      std::string attr_value = get_attribute_value (attr_type);
-      if ( !attr_value.empty ()) {
-
-       if (core->populate_contact_menu (ContactPtr(this, null_deleter ()),
-                                        attr_value, tmp_builder)) {
-
-         builder.add_ghost ("", get_attribute_name_from_type (attr_type));
-         tmp_builder.populate_menu (builder);
-         populated = true;
-       }
-      }
-    }
-  }
-
-  if (populated)
-    builder.add_separator ();
-
-  builder.add_action ("edit", _("_Edit"),
-                     boost::bind (&Evolution::Contact::edit_action, this));
-  builder.add_action ("remove", _("_Remove"),
-                     boost::bind (&Evolution::Contact::remove_action, this));
-  populated = true;
-
-  return populated;
-}
-
-
 std::string
 Evolution::Contact::get_attribute_name_from_type (unsigned int attribute_type) const
 {
diff --git a/plugins/evolution/evolution-contact.h b/plugins/evolution/evolution-contact.h
index 3657af6..0c3ea57 100644
--- a/plugins/evolution/evolution-contact.h
+++ b/plugins/evolution/evolution-contact.h
@@ -74,8 +74,6 @@ namespace Evolution
 
     bool has_uri (const std::string uri) const;
 
-    bool populate_menu (Ekiga::MenuBuilder &builder);
-
     void update_econtact (EContact *econtact);
 
     void remove ();
diff --git a/plugins/ldap/ldap-contact.cpp b/plugins/ldap/ldap-contact.cpp
index 363f9ac..778905c 100644
--- a/plugins/ldap/ldap-contact.cpp
+++ b/plugins/ldap/ldap-contact.cpp
@@ -82,28 +82,3 @@ OPENLDAP::Contact::has_uri (const std::string uri) const
 
   return result;
 }
-
-bool
-OPENLDAP::Contact::populate_menu (Ekiga::MenuBuilder &builder)
-{
-  boost::shared_ptr<Ekiga::ContactCore> contact_core = core.get<Ekiga::ContactCore> ("contact-core");
-  /* FIXME: add here the specific actions we want to allow
-   * (before or after the uri-specific actions)
-   */
-
-  Ekiga::TemporaryMenuBuilder tmp_builder;
-
-  bool result = false;
-  for (std::map<std::string, std::string>::const_iterator iter
-        = uris.begin ();
-       iter != uris.end ();
-       iter++) {
-    if (contact_core->populate_contact_menu (ContactPtr(this, null_deleter ()),
-                                            iter->second, tmp_builder)) {
-      builder.add_ghost ("", iter->second);
-      tmp_builder.populate_menu (builder);
-      result = true;
-    }
-  }
-  return result;
-}
diff --git a/plugins/ldap/ldap-contact.h b/plugins/ldap/ldap-contact.h
index a197c47..31fce6e 100644
--- a/plugins/ldap/ldap-contact.h
+++ b/plugins/ldap/ldap-contact.h
@@ -64,8 +64,6 @@ namespace OPENLDAP
 
     bool has_uri (const std::string uri) const;
 
-    bool populate_menu (Ekiga::MenuBuilder &builder);
-
   private:
 
     Ekiga::ServiceCore &core;


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