[ekiga/ds-fix-boost-leaks] Opal::Presentity: Ported to the new framework.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-fix-boost-leaks] Opal::Presentity: Ported to the new framework.
- Date: Sun, 21 Jun 2015 13:35:49 +0000 (UTC)
commit 0cbc905ef9fe3a40b0cb9fc7175493c1eec63582
Author: Damien Sandras <dsandras seconix com>
Date: Sun Jun 21 15:30:53 2015 +0200
Opal::Presentity: Ported to the new framework.
lib/engine/components/opal/opal-presentity.cpp | 26 +++++++++++++++++++----
lib/engine/components/opal/opal-presentity.h | 16 ++++++++++----
2 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-presentity.cpp b/lib/engine/components/opal/opal-presentity.cpp
index 36a6bdc..a0f2726 100644
--- a/lib/engine/components/opal/opal-presentity.cpp
+++ b/lib/engine/components/opal/opal-presentity.cpp
@@ -96,6 +96,22 @@ Opal::Presentity::build_node (const std::string name,
}
+boost::shared_ptr<Opal::Presentity>
+Opal::Presentity::create (const Account & _account,
+ boost::weak_ptr<Ekiga::PresenceCore> _presence_core,
+ boost::function0<std::list<std::string> > _existing_groups,
+ xmlNodePtr _node)
+{
+ boost::shared_ptr<Opal::Presentity> presentity =
+ boost::shared_ptr<Opal::Presentity> (new Opal::Presentity (_account,
+ _presence_core,
+ _existing_groups,
+ _node));
+
+ return presentity;
+}
+
+
Opal::Presentity::Presentity (const Opal::Account & account_,
boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
boost::function0<std::list<std::string> > existing_groups_,
@@ -229,7 +245,7 @@ void
Opal::Presentity::set_presence (const std::string presence_)
{
presence = presence_;
- updated ();
+ updated (this->shared_from_this ());
}
@@ -237,7 +253,7 @@ void
Opal::Presentity::set_status (const std::string status_)
{
status = status_;
- updated ();
+ updated (this->shared_from_this ());
}
@@ -364,7 +380,7 @@ Opal::Presentity::edit_presentity_form_submitted (bool submitted,
}
}
- updated ();
+ updated (this->shared_from_this ());
trigger_saving ();
return true;
@@ -428,7 +444,7 @@ Opal::Presentity::rename_group (const std::string old_name,
}
- updated ();
+ updated (this->shared_from_this ());
trigger_saving ();
}
@@ -440,5 +456,5 @@ Opal::Presentity::remove ()
xmlFreeNode (node);
trigger_saving ();
- removed ();
+ removed (this->shared_from_this ());
}
diff --git a/lib/engine/components/opal/opal-presentity.h b/lib/engine/components/opal/opal-presentity.h
index cb7f129..92dd050 100644
--- a/lib/engine/components/opal/opal-presentity.h
+++ b/lib/engine/components/opal/opal-presentity.h
@@ -45,6 +45,7 @@
#include "presence-core.h"
#include "presentity.h"
+#include "dynamic-object.h"
namespace Opal
@@ -58,7 +59,8 @@ namespace Opal
*/
class Presentity:
- public Ekiga::Presentity
+ public Ekiga::Presentity,
+ public Ekiga::DynamicObject<Presentity>
{
public:
@@ -68,10 +70,10 @@ namespace Opal
const std::string uri_,
const std::list<std::string> groups_);
- Presentity (const Account & account,
- boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
- boost::function0<std::list<std::string> > existing_groups_,
- xmlNodePtr node_);
+ static boost::shared_ptr<Presentity> create (const Account & _account,
+ boost::weak_ptr<Ekiga::PresenceCore> _presence_core,
+ boost::function0<std::list<std::string> > _existing_groups,
+ xmlNodePtr _node);
~Presentity ();
@@ -118,6 +120,10 @@ namespace Opal
void remove ();
private:
+ Presentity (const Account & account,
+ boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
+ boost::function0<std::list<std::string> > existing_groups_,
+ xmlNodePtr node_);
/* this pair of method is to let the user edit the presentity with
* a nice form
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]