[ekiga] Used FooPtr instead of gmref_ptr<Foo> like in the main code



commit cc02f49ddf7c69bc15651b7847d351252aef1076
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Wed Mar 25 11:49:54 2009 +0100

    Used FooPtr instead of gmref_ptr<Foo> like in the main code

 .../components/loudmouth/loudmouth-chat-simple.cpp |    4 ++--
 .../components/loudmouth/loudmouth-chat-simple.h   |    9 ++++++---
 .../components/loudmouth/loudmouth-cluster.h       |    3 +++
 .../components/loudmouth/loudmouth-dialect.cpp     |    8 ++++----
 .../components/loudmouth/loudmouth-dialect.h       |    6 ++++--
 lib/engine/components/loudmouth/loudmouth-heap.cpp |   14 +++++++-------
 lib/engine/components/loudmouth/loudmouth-heap.h   |   11 +++++++----
 lib/engine/components/loudmouth/loudmouth-main.cpp |    4 ++--
 .../components/loudmouth/loudmouth-presentity.h    |    3 +++
 9 files changed, 38 insertions(+), 24 deletions(-)
---
diff --git a/lib/engine/components/loudmouth/loudmouth-chat-simple.cpp b/lib/engine/components/loudmouth/loudmouth-chat-simple.cpp
index 550ec9a..97fe61f 100644
--- a/lib/engine/components/loudmouth/loudmouth-chat-simple.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-chat-simple.cpp
@@ -37,7 +37,7 @@
 
 #include "loudmouth-chat-simple.h"
 
-LM::SimpleChat::SimpleChat (gmref_ptr<Presentity> presentity_):
+LM::SimpleChat::SimpleChat (PresentityPtr presentity_):
   presentity(presentity_)
 {
   presentity->has_chat = true;
@@ -111,7 +111,7 @@ LM::SimpleChat::populate_menu (Ekiga::MenuBuilder& /*builder*/)
   return false; // FIXME;
 }
 
-gmref_ptr<Ekiga::Presentity>
+Ekiga::PresentityPtr
 LM::SimpleChat::get_presentity () const
 {
   return presentity;
diff --git a/lib/engine/components/loudmouth/loudmouth-chat-simple.h b/lib/engine/components/loudmouth/loudmouth-chat-simple.h
index 07b8cd5..2a01881 100644
--- a/lib/engine/components/loudmouth/loudmouth-chat-simple.h
+++ b/lib/engine/components/loudmouth/loudmouth-chat-simple.h
@@ -47,7 +47,7 @@ namespace LM
   {
   public:
 
-    SimpleChat (gmref_ptr<Presentity> presentity_);
+    SimpleChat (PresentityPtr presentity_);
 
     ~SimpleChat ();
 
@@ -61,7 +61,7 @@ namespace LM
 
     bool populate_menu (Ekiga::MenuBuilder& builder);
 
-    gmref_ptr<Ekiga::Presentity> get_presentity () const;
+    Ekiga::PresentityPtr get_presentity () const;
 
     /* specific api */
 
@@ -69,9 +69,12 @@ namespace LM
 
   private:
 
-    gmref_ptr<Presentity> presentity;
+    PresentityPtr presentity;
     std::list<gmref_ptr<Ekiga::ChatObserver> > observers;
   };
+
+  typedef gmref_ptr<SimpleChat> SimpleChatPtr;
+
 };
 
 #endif
diff --git a/lib/engine/components/loudmouth/loudmouth-cluster.h b/lib/engine/components/loudmouth/loudmouth-cluster.h
index 06ba62b..7125ca2 100644
--- a/lib/engine/components/loudmouth/loudmouth-cluster.h
+++ b/lib/engine/components/loudmouth/loudmouth-cluster.h
@@ -55,6 +55,9 @@ namespace LM
 
     bool populate_menu (Ekiga::MenuBuilder& builder);
   };
+
+  typedef gmref_ptr<Cluster> ClusterPtr;
+
 };
 
 #endif
diff --git a/lib/engine/components/loudmouth/loudmouth-dialect.cpp b/lib/engine/components/loudmouth/loudmouth-dialect.cpp
index f92a9d4..76b13df 100644
--- a/lib/engine/components/loudmouth/loudmouth-dialect.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-dialect.cpp
@@ -47,7 +47,7 @@ LM::Dialect::~Dialect ()
 }
 
 void
-LM::Dialect::push_message (gmref_ptr<Presentity> presentity,
+LM::Dialect::push_message (PresentityPtr presentity,
 			   const std::string msg)
 {
   bool found = false;
@@ -66,7 +66,7 @@ LM::Dialect::push_message (gmref_ptr<Presentity> presentity,
 
   if ( !found) {
 
-    gmref_ptr<SimpleChat> chat(new SimpleChat (presentity));
+    SimpleChatPtr chat(new SimpleChat (presentity));
 
     add_simple_chat (chat);
     chat->got_message (msg);
@@ -74,9 +74,9 @@ LM::Dialect::push_message (gmref_ptr<Presentity> presentity,
 }
 
 void
-LM::Dialect::open_chat (gmref_ptr<Presentity> presentity)
+LM::Dialect::open_chat (PresentityPtr presentity)
 {
-  gmref_ptr<SimpleChat> chat(new SimpleChat (presentity));
+  SimpleChatPtr chat(new SimpleChat (presentity));
   add_simple_chat (chat);
   chat->user_requested.emit ();
 }
diff --git a/lib/engine/components/loudmouth/loudmouth-dialect.h b/lib/engine/components/loudmouth/loudmouth-dialect.h
index 71936f2..5ae6543 100644
--- a/lib/engine/components/loudmouth/loudmouth-dialect.h
+++ b/lib/engine/components/loudmouth/loudmouth-dialect.h
@@ -54,11 +54,13 @@ namespace LM
 
     /* specific */
 
-    void push_message (gmref_ptr<Presentity>,
+    void push_message (PresentityPtr,
 		       const std::string msg);
 
-    void open_chat (gmref_ptr<Presentity> presentity);
+    void open_chat (PresentityPtr presentity);
   };
+
+  typedef gmref_ptr<Dialect> DialectPtr;
 };
 
 #endif
diff --git a/lib/engine/components/loudmouth/loudmouth-heap.cpp b/lib/engine/components/loudmouth/loudmouth-heap.cpp
index d8ec685..62ca5ae 100644
--- a/lib/engine/components/loudmouth/loudmouth-heap.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-heap.cpp
@@ -69,7 +69,7 @@ message_handler_c (LmMessageHandler* /*handler*/,
 }
 
 LM::Heap::Heap (gmref_ptr<Ekiga::PersonalDetails> details_,
-		gmref_ptr<Dialect> dialect_,
+		DialectPtr dialect_,
 		LmConnection* connection_):
   details(details_), dialect(dialect_), connection(connection_)
 {
@@ -186,7 +186,7 @@ LM::Heap::presence_handler (LmMessage* message)
     resource = std::string (from, index + 1, std::string::npos);
   }
 
-  gmref_ptr<Presentity> item = find_item (base_jid);
+  PresentityPtr item = find_item (base_jid);
 
   if (type_attr != NULL && strcmp (type_attr, "subscribe") == 0) {
 
@@ -257,7 +257,7 @@ LM::Heap::message_handler (LmMessage* message)
     base_jid = std::string (from, 0, index);
   }
 
-  gmref_ptr<Presentity> item = find_item (base_jid);
+  PresentityPtr item = find_item (base_jid);
 
   if (type_attr == NULL
       || (type_attr != NULL && strcmp (type_attr, "normal") == 0)
@@ -302,7 +302,7 @@ LM::Heap::parse_roster (LmMessageNode* query)
     }
     if ( !found) {
 
-      gmref_ptr<Presentity> presentity(new Presentity (connection, node));
+      PresentityPtr presentity(new Presentity (connection, node));
       presentity->chat_requested.connect (sigc::bind (sigc::mem_fun (this, &LM::Heap::on_chat_requested), presentity));
       add_presentity (presentity);
     }
@@ -404,10 +404,10 @@ LM::Heap::subscribe_from_form_submitted (bool submitted,
   }
 }
 
-gmref_ptr<LM::Presentity>
+LM::PresentityPtr
 LM::Heap::find_item (const std::string jid)
 {
-  gmref_ptr<Presentity> result;
+  PresentityPtr result;
 
   for (iterator iter = begin (); iter != end (); ++iter) {
 
@@ -434,7 +434,7 @@ LM::Heap::on_personal_details_updated ()
 }
 
 void
-LM::Heap::on_chat_requested (gmref_ptr<Presentity> presentity)
+LM::Heap::on_chat_requested (PresentityPtr presentity)
 {
   dialect->open_chat (presentity);
 }
diff --git a/lib/engine/components/loudmouth/loudmouth-heap.h b/lib/engine/components/loudmouth/loudmouth-heap.h
index ce72ba2..dec8dbf 100644
--- a/lib/engine/components/loudmouth/loudmouth-heap.h
+++ b/lib/engine/components/loudmouth/loudmouth-heap.h
@@ -49,7 +49,7 @@ namespace LM
   public:
 
     Heap (gmref_ptr<Ekiga::PersonalDetails> details_,
-	  gmref_ptr<Dialect> dialect_,
+	  DialectPtr dialect_,
 	  LmConnection* connection_);
 
     ~Heap ();
@@ -75,7 +75,7 @@ namespace LM
 
     gmref_ptr<Ekiga::PersonalDetails> details;
 
-    gmref_ptr<Dialect> dialect;
+    DialectPtr dialect;
 
     LmConnection* connection;
 
@@ -95,12 +95,15 @@ namespace LM
     void subscribe_from_form_submitted (bool submitted,
 					Ekiga::Form& result);
 
-    gmref_ptr<Presentity> find_item (const std::string jid);
+    PresentityPtr find_item (const std::string jid);
 
     void on_personal_details_updated ();
 
-    void on_chat_requested (gmref_ptr<Presentity> presentity);
+    void on_chat_requested (PresentityPtr presentity);
   };
+
+  typedef gmref_ptr<Heap> HeapPtr;
+
 };
 
 #endif
diff --git a/lib/engine/components/loudmouth/loudmouth-main.cpp b/lib/engine/components/loudmouth/loudmouth-main.cpp
index 330f2ea..a835869 100644
--- a/lib/engine/components/loudmouth/loudmouth-main.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-main.cpp
@@ -60,8 +60,8 @@ struct LOUDMOUTHSpark: public Ekiga::Spark
 
     if ( !service && presence && chat && details) {
 
-      gmref_ptr<LM::Dialect> dialect(new LM::Dialect);
-      gmref_ptr<LM::Cluster> cluster(new LM::Cluster);
+      LM::DialectPtr dialect(new LM::Dialect);
+      LM::ClusterPtr cluster(new LM::Cluster);
       gmref_ptr<LM::Bank> bank (new LM::Bank (details, dialect, cluster));
       core.add (bank);
       chat->add_dialect (dialect);
diff --git a/lib/engine/components/loudmouth/loudmouth-presentity.h b/lib/engine/components/loudmouth/loudmouth-presentity.h
index 33d7dd9..884a2ff 100644
--- a/lib/engine/components/loudmouth/loudmouth-presentity.h
+++ b/lib/engine/components/loudmouth/loudmouth-presentity.h
@@ -106,6 +106,9 @@ namespace LM
 
     void remove_presentity ();
   };
+
+  typedef gmref_ptr<Presentity> PresentityPtr;
+
 };
 
 #endif



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