[ekiga] Opal: Fixed double account registration.



commit ce54c30ccc394a46afd6ca7fe9333ed299ba619a
Author: Damien Sandras <dsandras seconix com>
Date:   Sun Apr 19 12:38:23 2015 +0200

    Opal: Fixed double account registration.

 lib/engine/components/opal/opal-bank.cpp |   18 +++++++-----------
 lib/engine/components/opal/opal-bank.h   |    2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index f61dcb0..eeee6f6 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -117,7 +117,7 @@ Opal::Bank::Bank (Ekiga::ServiceCore& core,
       add_account (account);
       heap_added (account);
 
-      start ();
+      activate (account);
     }
   }
 
@@ -593,20 +593,16 @@ Opal::Bank::add_actions ()
 
 
 void
-Opal::Bank::start ()
+Opal::Bank::activate (boost::shared_ptr<Opal::Account> account)
 {
   if (!endpoint.IsReady ()) {
-    endpoint.ready.connect (boost::bind (&Opal::Bank::start, this));
+    endpoint.ready.connect (boost::bind (&Opal::Bank::activate, this, account));
     return;
   }
 
   boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock ();
-  for (iterator iter = begin ();
-       iter != end ();
-       ++iter) {
-    if (pcore)
-      pcore->add_presence_fetcher (*iter);
-    if ((*iter)->is_enabled ())
-      (*iter)->enable ();
-  }
+  if (pcore)
+    pcore->add_presence_fetcher (account);
+  if (account->is_enabled ())
+    account->enable ();
 }
diff --git a/lib/engine/components/opal/opal-bank.h b/lib/engine/components/opal/opal-bank.h
index b82613e..5c0f742 100644
--- a/lib/engine/components/opal/opal-bank.h
+++ b/lib/engine/components/opal/opal-bank.h
@@ -169,7 +169,7 @@ private:
 
     void add_actions ();
 
-    void start ();
+    void activate (boost::shared_ptr<Account> account);
 
     Ekiga::Settings *protocols_settings;
 


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