ekiga r6729 - in trunk: lib/engine lib/engine/components/avahi-publisher lib/engine/framework lib/engine/presence/skel src/endpoints src/gui
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6729 - in trunk: lib/engine lib/engine/components/avahi-publisher lib/engine/framework lib/engine/presence/skel src/endpoints src/gui
- Date: Sat, 30 Aug 2008 07:02:06 +0000 (UTC)
Author: jpuydt
Date: Sat Aug 30 07:02:06 2008
New Revision: 6729
URL: http://svn.gnome.org/viewvc/ekiga?rev=6729&view=rev
Log:
Cleaned the PresencePublisher system a bit, and Ekiga::PersonalDetails a little
Modified:
trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp
trunk/lib/engine/engine.cpp
trunk/lib/engine/framework/personal-details.cpp
trunk/lib/engine/framework/personal-details.h
trunk/lib/engine/presence/skel/presence-core.cpp
trunk/lib/engine/presence/skel/presence-core.h
trunk/src/endpoints/sip-endpoint.cpp
trunk/src/gui/statusicon.cpp
Modified: trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp
==============================================================================
--- trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp (original)
+++ trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp Sat Aug 30 07:02:06 2008
@@ -99,8 +99,7 @@
/* Implementation of the class */
PresencePublisher::PresencePublisher (Ekiga::ServiceCore & _core)
-: Ekiga::PresencePublisher (_core),
- core (_core)
+: core (_core)
{
/* Create the GLIB Adaptor */
glib_poll = avahi_glib_poll_new (NULL, G_PRIORITY_DEFAULT);
Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp (original)
+++ trunk/lib/engine/engine.cpp Sat Aug 30 07:02:06 2008
@@ -105,8 +105,8 @@
/* VideoInputCore depends on VideoOutputCore and must this *
* be constructed thereafter */
- Ekiga::PresenceCore *presence_core = new Ekiga::PresenceCore;
Ekiga::AccountCore *account_core = new Ekiga::AccountCore;
+ Ekiga::PresenceCore *presence_core = NULL;
Ekiga::ContactCore *contact_core = new Ekiga::ContactCore;
Ekiga::CallCore *call_core = new Ekiga::CallCore;
Ekiga::ChatCore *chat_core = new Ekiga::ChatCore;
@@ -127,7 +127,6 @@
core->add (*runtime);
core->add (*account_core);
core->add (*contact_core);
- core->add (*presence_core);
core->add (*call_core);
core->add (*chat_core);
core->add (*videooutput_core);
@@ -141,6 +140,9 @@
return;
}
+ presence_core = new Ekiga::PresenceCore (*core);
+ core->add (*presence_core);
+
#ifndef WIN32
if (!videooutput_x_init (*core, &argc, &argv)) {
delete core;
Modified: trunk/lib/engine/framework/personal-details.cpp
==============================================================================
--- trunk/lib/engine/framework/personal-details.cpp (original)
+++ trunk/lib/engine/framework/personal-details.cpp Sat Aug 30 07:02:06 2008
@@ -60,19 +60,19 @@
void PersonalDetails::set_display_name (const std::string & _display_name)
{
display_name = _display_name;
- updated.emit (*this);
+ updated.emit ();
}
void PersonalDetails::set_short_status (const std::string & _short_status)
{
short_status = _short_status;
- updated.emit (*this);
+ updated.emit ();
}
void PersonalDetails::set_long_status (const std::string & _long_status)
{
long_status = _long_status;
- updated.emit (*this);
+ updated.emit ();
}
Modified: trunk/lib/engine/framework/personal-details.h
==============================================================================
--- trunk/lib/engine/framework/personal-details.h (original)
+++ trunk/lib/engine/framework/personal-details.h Sat Aug 30 07:02:06 2008
@@ -80,7 +80,7 @@
void set_long_status (const std::string & long_status);
- sigc::signal<void, PersonalDetails &> updated;
+ sigc::signal<void> updated;
private:
std::string display_name;
Modified: trunk/lib/engine/presence/skel/presence-core.cpp
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.cpp (original)
+++ trunk/lib/engine/presence/skel/presence-core.cpp Sat Aug 30 07:02:06 2008
@@ -40,45 +40,17 @@
#include "personal-details.h"
-Ekiga::PresencePublisher::PresencePublisher (Ekiga::ServiceCore & core)
+Ekiga::PresenceCore::PresenceCore (Ekiga::ServiceCore& core)
{
Ekiga::AccountCore *account_core = dynamic_cast <Ekiga::AccountCore *> (core.get ("account-core"));
Ekiga::PersonalDetails *details = dynamic_cast <Ekiga::PersonalDetails *> (core.get ("personal-details"));
if (details)
- details->updated.connect (sigc::mem_fun (this, &Ekiga::PresencePublisher::on_personal_details_updated));
+ details->updated.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::PresenceCore::publish), details));
if (account_core)
- account_core->registration_event.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::PresencePublisher::on_registration_event), details));
+ account_core->registration_event.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::PresenceCore::on_registration_event), details));
}
-
-void Ekiga::PresencePublisher::on_personal_details_updated (Ekiga::PersonalDetails &details)
-{
- this->publish (details);
-}
-
-
-void Ekiga::PresencePublisher::on_registration_event (const Ekiga::Account & /*account*/,
- Ekiga::AccountCore::RegistrationState state,
- std::string /*info*/,
- Ekiga::PersonalDetails *details)
-{
- switch (state) {
- case Ekiga::AccountCore::Registered:
- if (details)
- this->publish (*details);
- break;
-
- case Ekiga::AccountCore::Unregistered:
- case Ekiga::AccountCore::UnregistrationFailed:
- case Ekiga::AccountCore::RegistrationFailed:
- case Ekiga::AccountCore::Processing:
- default:
- break;
- }
-}
-
-
Ekiga::PresenceCore::~PresenceCore ()
{
}
@@ -213,13 +185,13 @@
presence_publishers.insert (&publisher);
}
-void Ekiga::PresenceCore::publish (const PersonalDetails & details)
+void Ekiga::PresenceCore::publish (const PersonalDetails* details)
{
for (std::set<PresencePublisher *>::iterator iter
= presence_publishers.begin ();
iter != presence_publishers.end ();
iter++)
- (*iter)->publish (details);
+ (*iter)->publish (*details);
}
bool
@@ -241,3 +213,13 @@
{
uri_testers.insert (tester);
}
+
+void
+Ekiga::PresenceCore::on_registration_event (const Ekiga::Account& /*account*/,
+ Ekiga::AccountCore::RegistrationState state,
+ std::string /*info*/,
+ Ekiga::PersonalDetails *details)
+{
+ if (state == Ekiga::AccountCore::Registered)
+ publish (details);
+}
Modified: trunk/lib/engine/presence/skel/presence-core.h
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.h (original)
+++ trunk/lib/engine/presence/skel/presence-core.h Sat Aug 30 07:02:06 2008
@@ -105,17 +105,9 @@
{
public:
- PresencePublisher (Ekiga::ServiceCore &);
- virtual ~PresencePublisher () {};
+ virtual ~PresencePublisher () {}
- virtual void publish (const PersonalDetails & details) = 0;
-
- private:
- void on_personal_details_updated (PersonalDetails &details);
- void on_registration_event (const Ekiga::Account & account,
- Ekiga::AccountCore::RegistrationState state,
- std::string /*info*/,
- Ekiga::PersonalDetails *details);
+ virtual void publish (const PersonalDetails& details) = 0;
};
/** Core object for the presence support.
@@ -149,7 +141,7 @@
/** The constructor.
*/
- PresenceCore () {}
+ PresenceCore (ServiceCore& core);
/** The destructor.
*/
@@ -275,11 +267,15 @@
void add_presence_publisher (PresencePublisher &publisher);
- void publish (const PersonalDetails & details);
-
private:
std::set<PresencePublisher *> presence_publishers;
+ void publish (const PersonalDetails* details);
+ void on_personal_details_updated (PersonalDetails &details);
+ void on_registration_event (const Ekiga::Account & account,
+ Ekiga::AccountCore::RegistrationState state,
+ std::string info,
+ Ekiga::PersonalDetails *details);
/*** API to control which uri are supported by runtime ***/
public:
Modified: trunk/src/endpoints/sip-endpoint.cpp
==============================================================================
--- trunk/src/endpoints/sip-endpoint.cpp (original)
+++ trunk/src/endpoints/sip-endpoint.cpp Sat Aug 30 07:02:06 2008
@@ -142,8 +142,7 @@
Opal::Sip::EndPoint::EndPoint (Opal::CallManager & _manager,
Ekiga::ServiceCore & _core,
unsigned _listen_port)
-: SIPEndPoint (_manager),
- Ekiga::PresencePublisher (_core),
+: SIPEndPoint (_manager),
manager (_manager),
core (_core),
presence_core (*(dynamic_cast<Ekiga::PresenceCore *> (core.get ("presence-core")))),
Modified: trunk/src/gui/statusicon.cpp
==============================================================================
--- trunk/src/gui/statusicon.cpp (original)
+++ trunk/src/gui/statusicon.cpp Sat Aug 30 07:02:06 2008
@@ -347,10 +347,10 @@
static void
-personal_details_updated_cb (Ekiga::PersonalDetails & details,
- gpointer self)
+personal_details_updated_cb (StatusIcon* self,
+ Ekiga::PersonalDetails* details)
{
- statusicon_set_status (STATUSICON (self), details.get_short_status ());
+ statusicon_set_status (self, details->get_short_status ());
}
@@ -550,8 +550,7 @@
GtkWidget *chat_window = GTK_WIDGET (frontend->get_chat_window ());
statusicon_set_status (self, details->get_short_status ());
- conn = details->updated.connect (sigc::bind (sigc::ptr_fun (personal_details_updated_cb),
- (gpointer) self));
+ conn = details->updated.connect (sigc::bind (sigc::ptr_fun (personal_details_updated_cb), self, details));
self->priv->connections.push_back (conn);
conn = call_core->established_call.connect (sigc::bind (sigc::ptr_fun (established_call_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]