[ekiga/jp-opal-roster] Opal::Presentity: try to get rid of the need for the whole cluster...
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/jp-opal-roster] Opal::Presentity: try to get rid of the need for the whole cluster...
- Date: Sat, 26 Oct 2013 18:57:47 +0000 (UTC)
commit 520593567a076ad6f2e1e796badc1d6f1cb7a8cc
Author: Julien Puydt <jpuydt free fr>
Date: Fri Oct 25 22:57:51 2013 +0200
Opal::Presentity: try to get rid of the need for the whole cluster...
lib/engine/components/opal/opal-presentity.cpp | 14 ++++----------
lib/engine/components/opal/opal-presentity.h | 8 +++-----
2 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-presentity.cpp b/lib/engine/components/opal/opal-presentity.cpp
index a1e6b5c..e28d0da 100644
--- a/lib/engine/components/opal/opal-presentity.cpp
+++ b/lib/engine/components/opal/opal-presentity.cpp
@@ -38,7 +38,6 @@
#include <glib/gi18n.h>
#include "form-request-simple.h"
-#include "opal-cluster.h"
#include "robust-xml.h"
#include "opal-presentity.h"
@@ -97,11 +96,11 @@ Opal::Presentity::build_node (const std::string name,
}
-Opal::Presentity::Presentity (boost::weak_ptr<Opal::Cluster> cluster_,
- boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
+Opal::Presentity::Presentity (boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
+ boost::function0<std::set<std::string> > existing_groups_,
xmlNodePtr node_):
- cluster(cluster_),
presence_core(presence_core_),
+ existing_groups(existing_groups_),
node(node_),
presence("unknown")
{
@@ -255,17 +254,12 @@ Opal::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
void
Opal::Presentity::edit_presentity ()
{
- ClusterPtr cluster = cluster.lock ();
-
- if (!cluster)
- return;
-
boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new
Ekiga::FormRequestSimple (boost::bind (&Opal::Presentity::edit_presentity_form_submitted, this, _1, _2)));
std::string name = get_name ();
std::string uri = get_uri ();
std::set<std::string> groups = get_groups ();
- std::set<std::string> all_groups = cluster->existing_groups ();
+ std::set<std::string> all_groups = existing_groups ();
request->title (_("Edit roster element"));
request->instructions (_("Please fill in this form to change an existing "
diff --git a/lib/engine/components/opal/opal-presentity.h b/lib/engine/components/opal/opal-presentity.h
index 604a394..91a23c9 100644
--- a/lib/engine/components/opal/opal-presentity.h
+++ b/lib/engine/components/opal/opal-presentity.h
@@ -64,8 +64,8 @@ namespace Opal
const std::string uri_,
const std::set<std::string> groups_);
- Presentity (boost::weak_ptr<Opal::Cluster> cluster_,
- boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
+ Presentity (boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
+ boost::function0<std::set<std::string> > existing_groups_,
xmlNodePtr node_);
~Presentity ();
@@ -123,10 +123,8 @@ namespace Opal
void edit_presentity_form_submitted (bool submitted,
Ekiga::Form& result);
- // FIXME: this is stupid! We only need the cluster to get a list of
- // existing groups in the edit presentity form!
- boost::weak_ptr<Opal::Cluster> cluster;
boost::weak_ptr<Ekiga::PresenceCore> presence_core;
+ boost::function0<std::set<std::string> > existing_groups;
xmlNodePtr node;
std::string presence;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]