ekiga r7595 - in trunk/lib/engine: . components/local-roster
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7595 - in trunk/lib/engine: . components/local-roster
- Date: Thu, 22 Jan 2009 20:51:17 +0000 (UTC)
Author: jpuydt
Date: Thu Jan 22 20:51:17 2009
New Revision: 7595
URL: http://svn.gnome.org/viewvc/ekiga?rev=7595&view=rev
Log:
Made the local roster bridge use kickstart
Modified:
trunk/lib/engine/components/local-roster/local-roster-bridge.cpp
trunk/lib/engine/components/local-roster/local-roster-bridge.h
trunk/lib/engine/engine.cpp
Modified: trunk/lib/engine/components/local-roster/local-roster-bridge.cpp
==============================================================================
--- trunk/lib/engine/components/local-roster/local-roster-bridge.cpp (original)
+++ trunk/lib/engine/components/local-roster/local-roster-bridge.cpp Thu Jan 22 20:51:17 2009
@@ -103,22 +103,42 @@
/* public api */
-bool
-local_roster_bridge_init (Ekiga::ServiceCore &core,
- int * /*argc*/,
- char ** /*argv*/[])
+struct LOCALROSTERBRIDGESpark: public Ekiga::Spark
{
- bool result = false;
- gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
- gmref_ptr<Local::Cluster> cluster = core.get ("local-cluster");
-
- if (cluster && contact_core) {
-
- gmref_ptr<Local::ContactDecorator> decorator (new Local::ContactDecorator (cluster));
- core.add (decorator);
- contact_core->add_contact_decorator (decorator);
- result = true;
+ LOCALROSTERBRIDGESpark (): result(false)
+ {}
+
+ bool try_initialize_more (Ekiga::ServiceCore& core,
+ int* /*argc*/,
+ char** /*argv*/[])
+ {
+ gmref_ptr<Ekiga::Service> 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");
+
+ if (cluster && contact_core && !service) {
+
+ gmref_ptr<Local::ContactDecorator> decorator (new Local::ContactDecorator (cluster));
+ core.add (decorator);
+ contact_core->add_contact_decorator (decorator);
+ result = true;
+ }
+
+ return result;
}
- return result;
+ Ekiga::Spark::state get_state () const
+ { return result?FULL:BLANK; }
+
+ const std::string get_name () const
+ { return "LOCALROSTERBRIDGE"; }
+
+ bool result;
+};
+
+void
+local_roster_bridge_init (Ekiga::KickStart& kickstart)
+{
+ gmref_ptr<Ekiga::Spark> spark(new LOCALROSTERBRIDGESpark);
+ kickstart.add_spark (spark);
}
Modified: trunk/lib/engine/components/local-roster/local-roster-bridge.h
==============================================================================
--- trunk/lib/engine/components/local-roster/local-roster-bridge.h (original)
+++ trunk/lib/engine/components/local-roster/local-roster-bridge.h Thu Jan 22 20:51:17 2009
@@ -38,16 +38,14 @@
#ifndef __LOCAL_ROSTER_BRIDGE_MAIN_H__
#define __LOCAL_ROSTER_BRIDGE_MAIN_H__
-#include "services.h"
+#include "kickstart.h"
/**
* @addtogroup presence
* @{
*/
-bool local_roster_bridge_init (Ekiga::ServiceCore &core,
- int *argc,
- char **argv[]);
+void local_roster_bridge_init (Ekiga::KickStart& kickstart);
/**
* @}
Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp (original)
+++ trunk/lib/engine/engine.cpp Thu Jan 22 20:51:17 2009
@@ -249,10 +249,7 @@
return;
}
- if (!local_roster_bridge_init (*service_core, &argc, &argv)) {
- delete service_core;
- return;
- }
+ local_roster_bridge_init (kickstart);
plugin_init (kickstart);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]