[ekiga] Sugar-coated the pointers to Ekiga::Service objects
- From: Julien Puydt <jpuydt src gnome org>
- To: svn-commits-list gnome org
- Subject: [ekiga] Sugar-coated the pointers to Ekiga::Service objects
- Date: Fri, 12 Jun 2009 09:12:04 -0400 (EDT)
commit b14c5f782a39d8a9048ff282a017d977709c10c8
Author: Julien Puydt <jpuydt gnome org>
Date: Fri Jun 12 14:49:29 2009 +0200
Sugar-coated the pointers to Ekiga::Service objects
Many line changed, but that should make the code both more readable,
and make it more sed-able, if we ever go boost.
.../avahi-publisher/avahi-publisher-main.cpp | 2 +-
lib/engine/components/avahi/avahi-main.cpp | 2 +-
.../components/call-history/history-main.cpp | 2 +-
.../gnome-session/gnome-session-main.cpp | 4 ++--
lib/engine/components/hal-dbus/hal-main-dbus.cpp | 4 ++--
lib/engine/components/kab/kab-main.cpp | 2 +-
lib/engine/components/kde/kde-main.cpp | 6 +++---
lib/engine/components/libnotify/libnotify-main.cpp | 4 ++--
.../local-roster/local-roster-bridge.cpp | 2 +-
.../components/local-roster/local-roster-main.cpp | 2 +-
lib/engine/components/loudmouth/loudmouth-main.cpp | 2 +-
.../null-audioinput/audioinput-main-null.cpp | 4 ++--
lib/engine/components/opal/opal-main.cpp | 4 ++--
.../components/ptlib/audioinput-main-ptlib.cpp | 4 ++--
.../components/ptlib/audiooutput-main-ptlib.cpp | 4 ++--
.../components/ptlib/videoinput-main-ptlib.cpp | 4 ++--
.../resource-list/resource-list-main.cpp | 2 +-
lib/engine/components/xcap/xcap-main.cpp | 2 +-
lib/engine/engine.cpp | 2 +-
lib/engine/framework/services.cpp | 11 +++++------
lib/engine/framework/services.h | 10 ++++++----
21 files changed, 40 insertions(+), 39 deletions(-)
---
diff --git a/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp b/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp
index 028b024..738cbcc 100644
--- a/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp
+++ b/lib/engine/components/avahi-publisher/avahi-publisher-main.cpp
@@ -47,7 +47,7 @@ struct AVAHIPUBSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("avahi-presence-publisher");
+ Ekiga::ServicePtr service = core.get ("avahi-presence-publisher");
gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
gmref_ptr<Ekiga::PersonalDetails> details = core.get ("personal-details");
diff --git a/lib/engine/components/avahi/avahi-main.cpp b/lib/engine/components/avahi/avahi-main.cpp
index eaa3ce7..2ea1738 100644
--- a/lib/engine/components/avahi/avahi-main.cpp
+++ b/lib/engine/components/avahi/avahi-main.cpp
@@ -48,7 +48,7 @@ struct AVAHISpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("avahi-core");
+ Ekiga::ServicePtr service = core.get ("avahi-core");
gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
if ( !service && presence_core) {
diff --git a/lib/engine/components/call-history/history-main.cpp b/lib/engine/components/call-history/history-main.cpp
index b7e6f3b..947a322 100644
--- a/lib/engine/components/call-history/history-main.cpp
+++ b/lib/engine/components/call-history/history-main.cpp
@@ -49,7 +49,7 @@ struct HISTORYSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("call-history-store");
+ Ekiga::ServicePtr service = core.get ("call-history-store");
gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
diff --git a/lib/engine/components/gnome-session/gnome-session-main.cpp b/lib/engine/components/gnome-session/gnome-session-main.cpp
index 8598775..0f8ef01 100644
--- a/lib/engine/components/gnome-session/gnome-session-main.cpp
+++ b/lib/engine/components/gnome-session/gnome-session-main.cpp
@@ -82,12 +82,12 @@ struct GNOMESESSIONSpark: public Ekiga::Spark
char** /*argv*/[])
{
gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
- gmref_ptr<Ekiga::Service> service = core.get ("gnome-session");
+ Ekiga::ServicePtr service = core.get ("gnome-session");
if (call_core && !service) {
result = true;
- core.add (gmref_ptr<Ekiga::Service> (new GNOMESESSIONService (call_core)));
+ core.add (Ekiga::ServicePtr (new GNOMESESSIONService (call_core)));
}
return result;
diff --git a/lib/engine/components/hal-dbus/hal-main-dbus.cpp b/lib/engine/components/hal-dbus/hal-main-dbus.cpp
index f2d4326..f7e6193 100644
--- a/lib/engine/components/hal-dbus/hal-main-dbus.cpp
+++ b/lib/engine/components/hal-dbus/hal-main-dbus.cpp
@@ -56,8 +56,8 @@ struct HALDBUSSpark: public Ekiga::Spark
HalManager_dbus *hal_manager = new HalManager_dbus(core);
hal_core->add_manager (*hal_manager);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("hal-dbus",
- "\tComponent bringing HAL through DBUS")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("hal-dbus",
+ "\tComponent bringing HAL through DBUS")));
result = true;
}
diff --git a/lib/engine/components/kab/kab-main.cpp b/lib/engine/components/kab/kab-main.cpp
index b355b78..984e6cf 100644
--- a/lib/engine/components/kab/kab-main.cpp
+++ b/lib/engine/components/kab/kab-main.cpp
@@ -48,7 +48,7 @@ struct KABSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> kde_core = core.get ("kde-core");
+ Ekiga::ServicePtr kde_core = core.get ("kde-core");
gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
if (contact_core && kde_core) {
diff --git a/lib/engine/components/kde/kde-main.cpp b/lib/engine/components/kde/kde-main.cpp
index b6f6a00..18a4c60 100644
--- a/lib/engine/components/kde/kde-main.cpp
+++ b/lib/engine/components/kde/kde-main.cpp
@@ -54,7 +54,7 @@ struct KDESpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> kde = core.get ("kde-core");
+ Ekiga::ServicePtr kde = core.get ("kde-core");
if ( !kde) {
@@ -65,8 +65,8 @@ struct KDESpark: public Ekiga::Spark
KCmdLineArgs::init (&about);
new KApplication (false);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("kde-core",
- "\tKDE support")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("kde-core",
+ "\tKDE support")));
result = true;
}
diff --git a/lib/engine/components/libnotify/libnotify-main.cpp b/lib/engine/components/libnotify/libnotify-main.cpp
index c353a98..124143f 100644
--- a/lib/engine/components/libnotify/libnotify-main.cpp
+++ b/lib/engine/components/libnotify/libnotify-main.cpp
@@ -82,11 +82,11 @@ struct LIBNOTIFYSpark: public Ekiga::Spark
char** /*argv*/[])
{
gmref_ptr<Ekiga::NotificationCore> notification = core.get ("notification-core");
- gmref_ptr<Ekiga::Service> service = core.get ("libnotify");
+ Ekiga::ServicePtr service = core.get ("libnotify");
if (notification && !service) {
- core.add (gmref_ptr<Ekiga::Service> (new LibNotify (notification)));
+ core.add (Ekiga::ServicePtr (new LibNotify (notification)));
result = true;
}
diff --git a/lib/engine/components/local-roster/local-roster-bridge.cpp b/lib/engine/components/local-roster/local-roster-bridge.cpp
index 9accf88..014dd7b 100644
--- a/lib/engine/components/local-roster/local-roster-bridge.cpp
+++ b/lib/engine/components/local-roster/local-roster-bridge.cpp
@@ -112,7 +112,7 @@ struct LOCALROSTERBRIDGESpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("local-roster-bridge");
+ Ekiga::ServicePtr service = core.get ("local-roster-bridge");
gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
gmref_ptr<Local::Cluster> cluster = core.get ("local-cluster");
diff --git a/lib/engine/components/local-roster/local-roster-main.cpp b/lib/engine/components/local-roster/local-roster-main.cpp
index 4bfcffd..8d35f69 100644
--- a/lib/engine/components/local-roster/local-roster-main.cpp
+++ b/lib/engine/components/local-roster/local-roster-main.cpp
@@ -48,7 +48,7 @@ struct LOCALROSTERSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("local-cluster");
+ Ekiga::ServicePtr service = core.get ("local-cluster");
gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
if (presence_core && !service) {
diff --git a/lib/engine/components/loudmouth/loudmouth-main.cpp b/lib/engine/components/loudmouth/loudmouth-main.cpp
index ac64860..78c340e 100644
--- a/lib/engine/components/loudmouth/loudmouth-main.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-main.cpp
@@ -54,7 +54,7 @@ struct LOUDMOUTHSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service(core.get ("loudmouth-bank"));
+ Ekiga::ServicePtr service(core.get ("loudmouth-bank"));
gmref_ptr<Ekiga::PresenceCore> presence (core.get ("presence-core"));
gmref_ptr<Ekiga::AccountCore> account (core.get ("account-core"));
gmref_ptr<Ekiga::ChatCore> chat (core.get ("chat-core"));
diff --git a/lib/engine/components/null-audioinput/audioinput-main-null.cpp b/lib/engine/components/null-audioinput/audioinput-main-null.cpp
index c8b2448..72c1e86 100644
--- a/lib/engine/components/null-audioinput/audioinput-main-null.cpp
+++ b/lib/engine/components/null-audioinput/audioinput-main-null.cpp
@@ -56,8 +56,8 @@ struct NULLAUDIOINPUTSpark: public Ekiga::Spark
GMAudioInputManager_null *audioinput_manager = new GMAudioInputManager_null(core);
audioinput_core->add_manager (*audioinput_manager);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("null-audio-input",
- "\tComponent bringing silent audio input")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("null-audio-input",
+ "\tComponent bringing silent audio input")));
result = true;
}
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index b3f8916..ed23dac 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -113,8 +113,8 @@ struct OPALSpark: public Ekiga::Spark
gmref_ptr<Ekiga::AudioOutputCore> audiooutput_core = core.get ("audiooutput-core");
gmref_ptr<Ekiga::VideoOutputCore> videooutput_core = core.get ("videooutput-core");
gmref_ptr<Ekiga::PersonalDetails> personal_details = core.get ("personal-details");
- gmref_ptr<Ekiga::Service> account_store = core.get ("opal-account-store");
- gmref_ptr<Ekiga::Service> sip_endpoint = core.get ("opal-sip-endpoint");
+ Ekiga::ServicePtr account_store = core.get ("opal-account-store");
+ Ekiga::ServicePtr sip_endpoint = core.get ("opal-sip-endpoint");
if (contact_core && presence_core && call_core && chat_core
&& account_core && audioinput_core && videoinput_core
diff --git a/lib/engine/components/ptlib/audioinput-main-ptlib.cpp b/lib/engine/components/ptlib/audioinput-main-ptlib.cpp
index 2c5799b..de46151 100644
--- a/lib/engine/components/ptlib/audioinput-main-ptlib.cpp
+++ b/lib/engine/components/ptlib/audioinput-main-ptlib.cpp
@@ -56,8 +56,8 @@ struct PTLIBAUDIOINPUTSpark: public Ekiga::Spark
GMAudioInputManager_ptlib *audioinput_manager = new GMAudioInputManager_ptlib(core);
audioinput_core->add_manager (*audioinput_manager);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("ptlib-audio-input",
- "\tComponent bringing PTLIB's audio input")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("ptlib-audio-input",
+ "\tComponent bringing PTLIB's audio input")));
result = true;
}
diff --git a/lib/engine/components/ptlib/audiooutput-main-ptlib.cpp b/lib/engine/components/ptlib/audiooutput-main-ptlib.cpp
index b9d20a0..45e5e04 100644
--- a/lib/engine/components/ptlib/audiooutput-main-ptlib.cpp
+++ b/lib/engine/components/ptlib/audiooutput-main-ptlib.cpp
@@ -56,8 +56,8 @@ struct PTLIBAUDIOOUTPUTSpark: public Ekiga::Spark
GMAudioOutputManager_ptlib *audiooutput_manager = new GMAudioOutputManager_ptlib(core);
audiooutput_core->add_manager (*audiooutput_manager);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("ptlib-audio-output",
- "\tComponent bringing PTLIB's audio output")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("ptlib-audio-output",
+ "\tComponent bringing PTLIB's audio output")));
result = true;
}
diff --git a/lib/engine/components/ptlib/videoinput-main-ptlib.cpp b/lib/engine/components/ptlib/videoinput-main-ptlib.cpp
index 350eea2..ecd0c6d 100644
--- a/lib/engine/components/ptlib/videoinput-main-ptlib.cpp
+++ b/lib/engine/components/ptlib/videoinput-main-ptlib.cpp
@@ -56,8 +56,8 @@ struct PTLIBVIDEOINPUTSpark: public Ekiga::Spark
GMVideoInputManager_ptlib *videoinput_manager = new GMVideoInputManager_ptlib(core);
videoinput_core->add_manager (*videoinput_manager);
- core.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("ptlib-video-input",
- "\tComponent bringing PTLIB's video input")));
+ core.add (Ekiga::ServicePtr (new Ekiga::BasicService ("ptlib-video-input",
+ "\tComponent bringing PTLIB's video input")));
result = true;
}
diff --git a/lib/engine/components/resource-list/resource-list-main.cpp b/lib/engine/components/resource-list/resource-list-main.cpp
index 8d54af9..1019371 100644
--- a/lib/engine/components/resource-list/resource-list-main.cpp
+++ b/lib/engine/components/resource-list/resource-list-main.cpp
@@ -50,7 +50,7 @@ struct RLSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("resource-list");
+ Ekiga::ServicePtr service = core.get ("resource-list");
gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
gmref_ptr<XCAP::Core> xcap = core.get ("xcap-core");
diff --git a/lib/engine/components/xcap/xcap-main.cpp b/lib/engine/components/xcap/xcap-main.cpp
index 26319e1..dae88b8 100644
--- a/lib/engine/components/xcap/xcap-main.cpp
+++ b/lib/engine/components/xcap/xcap-main.cpp
@@ -47,7 +47,7 @@ struct XCAPSpark: public Ekiga::Spark
int* /*argc*/,
char** /*argv*/[])
{
- gmref_ptr<Ekiga::Service> service = core.get ("xcap-core");
+ Ekiga::ServicePtr service = core.get ("xcap-core");
if ( !service) {
diff --git a/lib/engine/engine.cpp b/lib/engine/engine.cpp
index c9bd9d5..35c151e 100644
--- a/lib/engine/engine.cpp
+++ b/lib/engine/engine.cpp
@@ -140,7 +140,7 @@ engine_init (int argc,
Ekiga::KickStart kickstart;
- service_core->add (gmref_ptr<Ekiga::Service>(new Ekiga::NotificationCore));
+ service_core->add (Ekiga::ServicePtr(new Ekiga::NotificationCore));
/* VideoInputCore depends on VideoOutputCore and must this *
* be constructed thereafter */
diff --git a/lib/engine/framework/services.cpp b/lib/engine/framework/services.cpp
index d4d064c..3b61913 100644
--- a/lib/engine/framework/services.cpp
+++ b/lib/engine/framework/services.cpp
@@ -47,7 +47,7 @@ Ekiga::ServiceCore::~ServiceCore ()
}
bool
-Ekiga::ServiceCore::add (gmref_ptr<Service> service)
+Ekiga::ServiceCore::add (ServicePtr service)
{
bool result = false;
@@ -64,12 +64,12 @@ Ekiga::ServiceCore::add (gmref_ptr<Service> service)
return result;
}
-gmref_ptr<Ekiga::Service>
+Ekiga::ServicePtr
Ekiga::ServiceCore::get (const std::string name)
{
- gmref_ptr<Service> result;
+ ServicePtr result;
- for (std::list<gmref_ptr<Service> >::iterator iter = services.begin ();
+ for (services_type::iterator iter = services.begin ();
iter != services.end () && !result;
iter++)
if (name == (*iter)->get_name ()) {
@@ -82,8 +82,7 @@ Ekiga::ServiceCore::get (const std::string name)
void
Ekiga::ServiceCore::dump (std::ostream &stream) const
{
- for (std::list<gmref_ptr<Service> >::const_reverse_iterator iter
- = services.rbegin ();
+ for (services_type::const_reverse_iterator iter = services.rbegin ();
iter != services.rend ();
iter++)
stream << (*iter)->get_name ()
diff --git a/lib/engine/framework/services.h b/lib/engine/framework/services.h
index cb04f14..d50d20e 100644
--- a/lib/engine/framework/services.h
+++ b/lib/engine/framework/services.h
@@ -62,6 +62,7 @@ namespace Ekiga
virtual const std::string get_description () const = 0;
};
+ typedef gmref_ptr<Service> ServicePtr;
class ServiceCore
@@ -72,17 +73,18 @@ namespace Ekiga
~ServiceCore ();
- bool add (gmref_ptr<Service> service);
+ bool add (ServicePtr service);
- gmref_ptr<Service> get (const std::string name);
+ ServicePtr get (const std::string name);
void dump (std::ostream &stream) const;
- sigc::signal1<void, gmref_ptr<Service> > service_added;
+ sigc::signal1<void, ServicePtr> service_added;
private:
- std::list<gmref_ptr<Service> > services;
+ typedef std::list<ServicePtr> services_type;
+ services_type services;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]