ekiga r7415 - in trunk/lib/engine/components: kab kde resource-list xcap



Author: jpuydt
Date: Mon Nov 24 20:22:37 2008
New Revision: 7415
URL: http://svn.gnome.org/viewvc/ekiga?rev=7415&view=rev

Log:
Adapt to api and config.h changes

Modified:
   trunk/lib/engine/components/kab/kab-book.cpp
   trunk/lib/engine/components/kab/kab-contact.cpp
   trunk/lib/engine/components/kab/kab-main.cpp
   trunk/lib/engine/components/kab/kab-source.cpp
   trunk/lib/engine/components/kde/kde-main.cpp
   trunk/lib/engine/components/resource-list/resource-list-main.cpp
   trunk/lib/engine/components/resource-list/rl-cluster.cpp
   trunk/lib/engine/components/resource-list/rl-cluster.h
   trunk/lib/engine/components/resource-list/rl-heap.cpp
   trunk/lib/engine/components/resource-list/rl-heap.h
   trunk/lib/engine/components/resource-list/rl-presentity.cpp
   trunk/lib/engine/components/xcap/xcap-main.cpp
   trunk/lib/engine/components/xcap/xcap-path.cpp

Modified: trunk/lib/engine/components/kab/kab-book.cpp
==============================================================================
--- trunk/lib/engine/components/kab/kab-book.cpp	(original)
+++ trunk/lib/engine/components/kab/kab-book.cpp	Mon Nov 24 20:22:37 2008
@@ -52,7 +52,7 @@
        iter != kab->end ();
        iter++) {
 
-    add_contact (new Contact (core, &(*iter)));
+    add_contact (gmref_ptr<Contact> (new Contact (core, &(*iter))));
   }
 }
 

Modified: trunk/lib/engine/components/kab/kab-contact.cpp
==============================================================================
--- trunk/lib/engine/components/kab/kab-contact.cpp	(original)
+++ trunk/lib/engine/components/kab/kab-contact.cpp	Mon Nov 24 20:22:37 2008
@@ -83,8 +83,10 @@
        iter++) {
 
     std::string precision = (*iter).typeLabel ().toUtf8 ().constData ();
-    result = result || core.populate_contact_menu (this,
-						   (*iter).number ().toUtf8 ().constData (), builder);
+    result = result
+      || core.populate_contact_menu (gmref_ptr<Ekiga::Contact>(this),
+				     (*iter).number ().toUtf8 ().constData (),
+				     builder);
   }
 
   return result;

Modified: trunk/lib/engine/components/kab/kab-main.cpp
==============================================================================
--- trunk/lib/engine/components/kab/kab-main.cpp	(original)
+++ trunk/lib/engine/components/kab/kab-main.cpp	Mon Nov 24 20:22:37 2008
@@ -50,7 +50,7 @@
 
   if (contact_core && kde_core) {
 
-    gmref_ptr<KAB::Source> source = new KAB::Source (*contact_core);
+    gmref_ptr<KAB::Source> source (new KAB::Source (*contact_core));
     core.add (source);
     contact_core->add_source (source);
     result = true;

Modified: trunk/lib/engine/components/kab/kab-source.cpp
==============================================================================
--- trunk/lib/engine/components/kab/kab-source.cpp	(original)
+++ trunk/lib/engine/components/kab/kab-source.cpp	Mon Nov 24 20:22:37 2008
@@ -41,7 +41,7 @@
 
 KAB::Source::Source (Ekiga::ContactCore &_core): core(_core)
 {
-  add_book (new KAB::Book (core));
+  add_book (gmref_ptr<Book>(new KAB::Book (core)));
 }
 
 KAB::Source::~Source ()

Modified: trunk/lib/engine/components/kde/kde-main.cpp
==============================================================================
--- trunk/lib/engine/components/kde/kde-main.cpp	(original)
+++ trunk/lib/engine/components/kde/kde-main.cpp	Mon Nov 24 20:22:37 2008
@@ -54,8 +54,8 @@
 
   KCmdLineArgs::init (&about);
   new KApplication (false);
-  services.add (new Ekiga::BasicService ("kde-core",
-					 "KDE support"));
+  services.add (gmref_ptr<Ekiga::Service> (new Ekiga::BasicService ("kde-core",
+								    "KDE support")));
 
   return true;
 }

Modified: trunk/lib/engine/components/resource-list/resource-list-main.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/resource-list-main.cpp	(original)
+++ trunk/lib/engine/components/resource-list/resource-list-main.cpp	Mon Nov 24 20:22:37 2008
@@ -56,9 +56,9 @@
 
     if (core && xcap) {
 
-      gmref_ptr<RL::Cluster> cluster = new RL::Cluster (services);
+      gmref_ptr<RL::Cluster> cluster (new RL::Cluster (services));
       services.add (cluster);
-      core->add_cluster (*cluster);
+      core->add_cluster (cluster);
       result = true;
     }
   }

Modified: trunk/lib/engine/components/resource-list/rl-cluster.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-cluster.cpp	(original)
+++ trunk/lib/engine/components/resource-list/rl-cluster.cpp	Mon Nov 24 20:22:37 2008
@@ -36,6 +36,7 @@
  */
 
 #include "config.h"
+#include <glib/gi18n.h>
 
 #include "rl-cluster.h"
 
@@ -107,9 +108,9 @@
 void
 RL::Cluster::add (xmlNodePtr node)
 {
-  Heap* heap = new Heap (core, node);
+  gmref_ptr<Heap> heap (new Heap (core, node));
 
-  common_add (*heap);
+  common_add (heap);
 }
 
 void
@@ -120,23 +121,23 @@
 		  const std::string name,
 		  bool writable)
 {
-  Heap* heap = new Heap (core, name, uri, user, username, password, writable);
+  gmref_ptr<Heap> heap (new Heap (core, name, uri, user, username, password, writable));
   xmlNodePtr root = xmlDocGetRootElement (doc);
 
   xmlAddChild (root, heap->get_node ());
 
   save ();
-  common_add (*heap);
+  common_add (heap);
 }
 
 void
-RL::Cluster::common_add (Heap& heap)
+RL::Cluster::common_add (gmref_ptr<Heap> heap)
 {
   add_heap (heap);
 
   // FIXME: here we should ask for presence for the heap...
 
-  heap.trigger_saving.connect (sigc::mem_fun (this, &RL::Cluster::save));
+  heap->trigger_saving.connect (sigc::mem_fun (this, &RL::Cluster::save));
 }
 
 void
@@ -217,7 +218,7 @@
        iter != end ();
        ++iter) {
 
-    iter->push_presence (uri, presence);
+    (*iter)->push_presence (uri, presence);
   }
 }
 
@@ -229,6 +230,6 @@
        iter != end ();
        ++iter) {
 
-    iter->push_status (uri, status);
+    (*iter)->push_status (uri, status);
   }
 }

Modified: trunk/lib/engine/components/resource-list/rl-cluster.h
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-cluster.h	(original)
+++ trunk/lib/engine/components/resource-list/rl-cluster.h	Mon Nov 24 20:22:37 2008
@@ -74,7 +74,7 @@
 	      const std::string user,
 	      const std::string name,
 	      bool writable);
-    void common_add (Heap& heap);
+    void common_add (gmref_ptr<Heap> heap);
     void save () const;
 
     void new_heap (const std::string name,

Modified: trunk/lib/engine/components/resource-list/rl-heap.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-heap.cpp	(original)
+++ trunk/lib/engine/components/resource-list/rl-heap.cpp	Mon Nov 24 20:22:37 2008
@@ -35,7 +35,7 @@
  *
  */
 
-#include "config.h"
+#include <glib/gi18n.h>
 
 #include <iostream>
 
@@ -183,7 +183,7 @@
 }
 
 void
-RL::Heap::visit_presentities (sigc::slot1<bool, Ekiga::Presentity&> visitor)
+RL::Heap::visit_presentities (sigc::slot1<bool, gmref_ptr<Ekiga::Presentity> > visitor)
 {
   bool go_on = true;
 
@@ -191,7 +191,7 @@
 	 iter = presentities.begin ();
        go_on && iter != presentities.end ();
        ++iter)
-    go_on = visitor (*iter->first);
+    go_on = visitor (iter->first);
 }
 
 bool
@@ -371,12 +371,12 @@
 
       gmref_ptr<Presentity> presentity(new Presentity (services, path, child, writable));
       std::list<sigc::connection> conns;
-      conns.push_back (presentity->updated.connect (sigc::bind (sigc::mem_fun (this, &RL::Heap::on_presentity_updated),presentity)));
-      conns.push_back (presentity->removed.connect (sigc::bind(sigc::mem_fun (this, &RL::Heap::on_presentity_removed),presentity)));
+      conns.push_back (presentity->updated.connect (sigc::bind (presentity_updated.make_slot (),presentity)));
+      conns.push_back (presentity->removed.connect (sigc::bind(presentity_removed.make_slot (),presentity)));
       conns.push_back (presentity->trigger_reload.connect (sigc::mem_fun (this, &RL::Heap::refresh)));
       conns.push_back (presentity->questions.connect (questions.make_slot()));
       presentities[presentity]=conns;
-      presentity_added.emit (*presentity);
+      presentity_added.emit (presentity);
       continue;
     }
 }
@@ -648,15 +648,3 @@
 
   refresh ();
 }
-
-void
-RL::Heap::on_presentity_updated (gmref_ptr<Presentity> presentity)
-{
-  presentity_updated.emit (*presentity);
-}
-
-void
-RL::Heap::on_presentity_removed (gmref_ptr<Presentity> presentity)
-{
-  presentity_removed.emit (*presentity);
-}

Modified: trunk/lib/engine/components/resource-list/rl-heap.h
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-heap.h	(original)
+++ trunk/lib/engine/components/resource-list/rl-heap.h	Mon Nov 24 20:22:37 2008
@@ -73,7 +73,7 @@
 
     const std::string get_name () const;
 
-    void visit_presentities (sigc::slot1<bool, Ekiga::Presentity&> visitor);
+    void visit_presentities (sigc::slot1<bool, gmref_ptr<Ekiga::Presentity> > visitor);
 
     bool populate_menu (Ekiga::MenuBuilder& builder);
 
@@ -122,9 +122,6 @@
     void on_new_entry_form_submitted (bool submitted,
 				      Ekiga::Form& result);
     void new_entry_result (std::string error);
-
-    void on_presentity_updated (gmref_ptr<Presentity> presentity);
-    void on_presentity_removed (gmref_ptr<Presentity> presentity);
   };
 };
 

Modified: trunk/lib/engine/components/resource-list/rl-presentity.cpp
==============================================================================
--- trunk/lib/engine/components/resource-list/rl-presentity.cpp	(original)
+++ trunk/lib/engine/components/resource-list/rl-presentity.cpp	Mon Nov 24 20:22:37 2008
@@ -37,7 +37,7 @@
 #include <iostream>
 #include <set>
 
-#include "config.h"
+#include <glib/gi18n.h>
 
 #include "form-request-simple.h"
 #include "robust-xml.h"
@@ -193,7 +193,7 @@
   bool populated = false;
   gmref_ptr<Ekiga::PresenceCore> presence_core(services.get ("presence-core"));
 
-  populated = presence_core->populate_presentity_menu (*this, uri, builder);
+  populated = presence_core->populate_presentity_menu (gmref_ptr<Presentity> (this), uri, builder);
 
   if (writable) {
 

Modified: trunk/lib/engine/components/xcap/xcap-main.cpp
==============================================================================
--- trunk/lib/engine/components/xcap/xcap-main.cpp	(original)
+++ trunk/lib/engine/components/xcap/xcap-main.cpp	Mon Nov 24 20:22:37 2008
@@ -41,7 +41,7 @@
 bool
 xcap_init (Ekiga::ServiceCore& core)
 {
-  gmref_ptr<XCAP::Core> xcap = new XCAP::Core ();
+  gmref_ptr<XCAP::Core> xcap(new XCAP::Core ());
 
   core.add (xcap);
 

Modified: trunk/lib/engine/components/xcap/xcap-path.cpp
==============================================================================
--- trunk/lib/engine/components/xcap/xcap-path.cpp	(original)
+++ trunk/lib/engine/components/xcap/xcap-path.cpp	Mon Nov 24 20:22:37 2008
@@ -89,8 +89,8 @@
 gmref_ptr<XCAP::Path>
 XCAP::Path::build_child (const std::string name)
 {
-  gmref_ptr<Path> result = new Path (root, application, user,
-				     relative, username, password);
+  gmref_ptr<Path> result (new Path (root, application, user,
+				    relative, username, password));
   result->relative = relative + "/" + name;
 
   return result;
@@ -101,8 +101,8 @@
 					const std::string attr,
 					const std::string value)
 {
-  gmref_ptr<Path> result = new Path (root, application, user, relative,
-				     username, password);
+  gmref_ptr<Path> result (new Path (root, application, user, relative,
+				    username, password));
   result->relative = relative + "/" + name +"%5b@" + attr + "=%22" + value + "%22%5d";
 
   return result;
@@ -113,8 +113,8 @@
 				       int position)
 {
   std::ostringstream stream;
-  gmref_ptr<Path> result = new Path (root, application, user, relative,
-				     username, password);
+  gmref_ptr<Path> result (new Path (root, application, user, relative,
+				    username, password));
 
   /* notice: Snark hates C++ */
   stream << name << "%5b" << position << "%5d";



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]