[Telepathy-commits] [telepathy-qt4/master] call example: Use ContactPtr typedef.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Thu Mar 19 08:38:22 PDT 2009


---
 examples/call/call-handler.cpp       |    6 +++---
 examples/call/call-handler.h         |    5 ++---
 examples/call/call-roster-widget.cpp |    4 ++--
 examples/call/call-roster-widget.h   |    4 +++-
 examples/call/call-widget.cpp        |    2 +-
 examples/call/call-widget.h          |    8 ++++----
 examples/call/call-window.h          |    1 -
 7 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/examples/call/call-handler.cpp b/examples/call/call-handler.cpp
index b2edfcd..d946b37 100644
--- a/examples/call/call-handler.cpp
+++ b/examples/call/call-handler.cpp
@@ -49,7 +49,7 @@ CallHandler::~CallHandler()
     }
 }
 
-void CallHandler::addOutgoingCall(const QSharedPointer<Contact> &contact)
+void CallHandler::addOutgoingCall(const ContactPtr &contact)
 {
     QVariantMap request;
     request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".ChannelType"),
@@ -113,7 +113,7 @@ void CallHandler::onOutgoingChannelReady(PendingOperation *op)
     }
 
     ContactManager *cm = chan->connection()->contactManager();
-    QSharedPointer<Contact> contact = cm->lookupContactByHandle(chan->targetHandle());
+    ContactPtr contact = cm->lookupContactByHandle(chan->targetHandle());
     Q_ASSERT(contact);
 
     CallWidget *call = new CallWidget(chan, contact);
@@ -138,7 +138,7 @@ void CallHandler::onIncomingChannelReady(PendingOperation *op)
         return;
     }
 
-    QSharedPointer<Contact> contact = chan->initiatorContact();
+    ContactPtr contact = chan->initiatorContact();
 
     QMessageBox msgBox;
     msgBox.setText("Incoming call");
diff --git a/examples/call/call-handler.h b/examples/call/call-handler.h
index e202215..4a0874b 100644
--- a/examples/call/call-handler.h
+++ b/examples/call/call-handler.h
@@ -22,13 +22,12 @@
 #define _TelepathyQt4_examples_call_call_handler_h_HEADER_GUARD_
 
 #include <QObject>
-#include <QSharedPointer>
 
 #include <TelepathyQt4/Client/Channel>
+#include <TelepathyQt4/Client/Contact>
 
 namespace Telepathy {
 namespace Client {
-class Contact;
 class PendingOperation;
 class StreamedMediaChannel;
 }
@@ -44,7 +43,7 @@ public:
     CallHandler(QObject *parent = 0);
     virtual ~CallHandler();
 
-    void addOutgoingCall(const QSharedPointer<Telepathy::Client::Contact> &contact);
+    void addOutgoingCall(const Telepathy::Client::ContactPtr &contact);
     void addIncomingCall(Telepathy::Client::StreamedMediaChannel *chan);
 
 private Q_SLOTS:
diff --git a/examples/call/call-roster-widget.cpp b/examples/call/call-roster-widget.cpp
index 1844855..5e593cd 100644
--- a/examples/call/call-roster-widget.cpp
+++ b/examples/call/call-roster-widget.cpp
@@ -50,7 +50,7 @@ CallRosterWidget::~CallRosterWidget()
 {
 }
 
-RosterItem *CallRosterWidget::createItemForContact(const QSharedPointer<Contact> &contact,
+RosterItem *CallRosterWidget::createItemForContact(const ContactPtr &contact,
         bool &exists)
 {
     return RosterWidget::createItemForContact(contact, exists);
@@ -85,6 +85,6 @@ void CallRosterWidget::onCallActionTriggered(bool checked)
 
     Q_ASSERT(selectedItems.size() == 1);
     RosterItem *item = dynamic_cast<RosterItem*>(selectedItems.first());
-    QSharedPointer<Contact> contact = item->contact();
+    ContactPtr contact = item->contact();
     mCallHandler->addOutgoingCall(contact);
 }
diff --git a/examples/call/call-roster-widget.h b/examples/call/call-roster-widget.h
index 45e7fd1..b9be603 100644
--- a/examples/call/call-roster-widget.h
+++ b/examples/call/call-roster-widget.h
@@ -21,6 +21,8 @@
 #ifndef _TelepathyQt4_examples_call_call_roster_widget_h_HEADER_GUARD_
 #define _TelepathyQt4_examples_call_call_roster_widget_h_HEADER_GUARD_
 
+#include <TelepathyQt4/Client/Contact>
+
 #include <examples/roster/roster-widget.h>
 
 namespace Telepathy {
@@ -42,7 +44,7 @@ public:
 
 protected:
     virtual RosterItem *createItemForContact(
-            const QSharedPointer<Telepathy::Client::Contact> &contact,
+            const Telepathy::Client::ContactPtr &contact,
             bool &exists);
     virtual void updateActions(RosterItem *item);
 
diff --git a/examples/call/call-widget.cpp b/examples/call/call-widget.cpp
index 284c96c..0bb220a 100644
--- a/examples/call/call-widget.cpp
+++ b/examples/call/call-widget.cpp
@@ -41,7 +41,7 @@
 using namespace Telepathy::Client;
 
 CallWidget::CallWidget(StreamedMediaChannel *chan,
-        const QSharedPointer<Contact> &contact,
+        const ContactPtr &contact,
         QWidget *parent)
     : QWidget(parent),
       mChan(chan),
diff --git a/examples/call/call-widget.h b/examples/call/call-widget.h
index f6eef6c..1c0b365 100644
--- a/examples/call/call-widget.h
+++ b/examples/call/call-widget.h
@@ -25,13 +25,13 @@
 #include <QWidget>
 
 #include <TelepathyQt4/Client/Channel>
+#include <TelepathyQt4/Client/Contact>
 #include <TelepathyQt4/Constants>
 
 #include "farsight-channel.h"
 
 namespace Telepathy {
 namespace Client {
-class Contact;
 class DBusProxy;
 class MediaStream;
 class PendingMediaStreams;
@@ -50,12 +50,12 @@ class CallWidget : public QWidget
 
 public:
     CallWidget(Telepathy::Client::StreamedMediaChannel *channel,
-               const QSharedPointer<Telepathy::Client::Contact> &contact,
+               const Telepathy::Client::ContactPtr &contact,
                QWidget *parent = 0);
     virtual ~CallWidget();
 
     Telepathy::Client::StreamedMediaChannel *channel() const { return mChan; }
-    QSharedPointer<Telepathy::Client::Contact> contact() const { return mContact; }
+    Telepathy::Client::ContactPtr contact() const { return mContact; }
 
 private Q_SLOTS:
     void onChannelReady(Telepathy::Client::PendingOperation *);
@@ -86,7 +86,7 @@ private:
     void callEnded(const QString &message);
 
     Telepathy::Client::StreamedMediaChannel *mChan;
-    QSharedPointer<Telepathy::Client::Contact> mContact;
+    Telepathy::Client::ContactPtr mContact;
     Telepathy::Client::FarsightChannel *mTfChan;
 
     Telepathy::Client::PendingMediaStreams *mPmsAudio;
diff --git a/examples/call/call-window.h b/examples/call/call-window.h
index bc1e436..f2244bb 100644
--- a/examples/call/call-window.h
+++ b/examples/call/call-window.h
@@ -22,7 +22,6 @@
 #define _TelepathyQt4_examples_call_call_window_h_HEADER_GUARD_
 
 #include <QMainWindow>
-#include <QSharedPointer>
 
 #include <TelepathyQt4/Client/Connection>
 #include <TelepathyQt4/Types>
-- 
1.5.6.5




More information about the telepathy-commits mailing list