[telepathy-qt4/master] Added Client/Types and moved all XXXPtr typedefs to it.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Mar 31 07:30:47 PDT 2009


Proper typedef classes using SharedPtr and make them inherit SharedData.
---
 TelepathyQt4/Client/Types                    |   13 ++++++
 TelepathyQt4/Client/account-manager.h        |    8 +--
 TelepathyQt4/Client/account.h                |    8 +--
 TelepathyQt4/Client/channel.h                |    8 +--
 TelepathyQt4/Client/connection-manager.h     |    8 +--
 TelepathyQt4/Client/connection.h             |    8 +--
 TelepathyQt4/Client/file-transfer.h          |    2 -
 TelepathyQt4/Client/room-list.h              |    2 -
 TelepathyQt4/Client/streamed-media-channel.h |    8 +--
 TelepathyQt4/Client/text-channel.h           |    2 -
 TelepathyQt4/Client/types.h                  |   61 ++++++++++++++++++++++++++
 TelepathyQt4/Makefile.am                     |    4 +-
 12 files changed, 95 insertions(+), 37 deletions(-)
 create mode 100644 TelepathyQt4/Client/Types
 create mode 100644 TelepathyQt4/Client/types.h

diff --git a/TelepathyQt4/Client/Types b/TelepathyQt4/Client/Types
new file mode 100644
index 0000000..79cb0db
--- /dev/null
+++ b/TelepathyQt4/Client/Types
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_Types_HEADER_GUARD_
+#define _TelepathyQt4_Client_Types_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/types.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/account-manager.h b/TelepathyQt4/Client/account-manager.h
index 57ee90e..1e54903 100644
--- a/TelepathyQt4/Client/account-manager.h
+++ b/TelepathyQt4/Client/account-manager.h
@@ -34,11 +34,11 @@
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 #include <TelepathyQt4/Client/ReadinessHelper>
 #include <TelepathyQt4/Client/ReadyObject>
+#include <TelepathyQt4/Client/Types>
+#include <TelepathyQt4/SharedPtr>
 
 #include <QDBusObjectPath>
-#include <QExplicitlySharedDataPointer>
 #include <QSet>
-#include <QSharedData>
 #include <QString>
 #include <QVariantMap>
 
@@ -54,7 +54,7 @@ class PendingReady;
 class AccountManager : public StatelessDBusProxy,
                        private OptionalInterfaceFactory<AccountManager>,
                        public ReadyObject,
-                       public QSharedData
+                       public SharedData
 {
     Q_OBJECT
     Q_DISABLE_COPY(AccountManager)
@@ -111,8 +111,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<AccountManager> AccountManagerPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/account.h b/TelepathyQt4/Client/account.h
index 57b0370..dcf8e58 100644
--- a/TelepathyQt4/Client/account.h
+++ b/TelepathyQt4/Client/account.h
@@ -34,11 +34,11 @@
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 #include <TelepathyQt4/Client/ReadinessHelper>
 #include <TelepathyQt4/Client/ReadyObject>
+#include <TelepathyQt4/Client/Types>
 #include <TelepathyQt4/Constants>
+#include <TelepathyQt4/SharedPtr>
 
-#include <QExplicitlySharedDataPointer>
 #include <QSet>
-#include <QSharedData>
 #include <QString>
 #include <QStringList>
 #include <QVariantMap>
@@ -59,7 +59,7 @@ class ProtocolInfo;
 class Account : public StatelessDBusProxy,
                 private OptionalInterfaceFactory<Account>,
                 public ReadyObject,
-                public QSharedData
+                public SharedData
 
 {
     Q_OBJECT
@@ -194,8 +194,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<Account> AccountPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/channel.h b/TelepathyQt4/Client/channel.h
index 8b74253..7208946 100644
--- a/TelepathyQt4/Client/channel.h
+++ b/TelepathyQt4/Client/channel.h
@@ -35,10 +35,10 @@
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 #include <TelepathyQt4/Client/ReadinessHelper>
 #include <TelepathyQt4/Client/ReadyObject>
+#include <TelepathyQt4/Client/Types>
+#include <TelepathyQt4/SharedPtr>
 
-#include <QExplicitlySharedDataPointer>
 #include <QSet>
-#include <QSharedData>
 #include <QVariantMap>
 
 namespace Telepathy
@@ -53,7 +53,7 @@ class PendingReady;
 class Channel : public StatefulDBusProxy,
                 private OptionalInterfaceFactory<Channel>,
                 public ReadyObject,
-                public QSharedData
+                public SharedData
 {
     Q_OBJECT
     Q_DISABLE_COPY(Channel)
@@ -308,8 +308,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<Channel> ChannelPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/connection-manager.h b/TelepathyQt4/Client/connection-manager.h
index a6b272a..2c8854f 100644
--- a/TelepathyQt4/Client/connection-manager.h
+++ b/TelepathyQt4/Client/connection-manager.h
@@ -33,11 +33,11 @@
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 #include <TelepathyQt4/Client/ReadinessHelper>
 #include <TelepathyQt4/Client/ReadyObject>
+#include <TelepathyQt4/Client/Types>
 #include <TelepathyQt4/Constants>
+#include <TelepathyQt4/SharedPtr>
 
-#include <QExplicitlySharedDataPointer>
 #include <QSet>
-#include <QSharedData>
 
 namespace Telepathy
 {
@@ -121,7 +121,7 @@ private:
 class ConnectionManager : public StatelessDBusProxy,
                           private OptionalInterfaceFactory<ConnectionManager>,
                           public ReadyObject,
-                          public QSharedData
+                          public SharedData
 {
     Q_OBJECT
 
@@ -168,8 +168,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<ConnectionManager> ConnectionManagerPtr;
-
 }
 }
 
diff --git a/TelepathyQt4/Client/connection.h b/TelepathyQt4/Client/connection.h
index 8e1678d..e24a660 100644
--- a/TelepathyQt4/Client/connection.h
+++ b/TelepathyQt4/Client/connection.h
@@ -34,13 +34,13 @@
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 #include <TelepathyQt4/Client/ReadinessHelper>
 #include <TelepathyQt4/Client/ReadyObject>
+#include <TelepathyQt4/Client/Types>
+#include <TelepathyQt4/SharedPtr>
 
 #include <TelepathyQt4/Constants>
 #include <TelepathyQt4/Types>
 
-#include <QExplicitlySharedDataPointer>
 #include <QSet>
-#include <QSharedData>
 #include <QString>
 #include <QStringList>
 
@@ -61,7 +61,7 @@ class PendingReady;
 class Connection : public StatefulDBusProxy,
                    private OptionalInterfaceFactory<Connection>,
                    public ReadyObject,
-                   public QSharedData
+                   public SharedData
 {
     Q_OBJECT
     Q_DISABLE_COPY(Connection)
@@ -218,8 +218,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<Connection> ConnectionPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/file-transfer.h b/TelepathyQt4/Client/file-transfer.h
index 00ba9a4..f493173 100644
--- a/TelepathyQt4/Client/file-transfer.h
+++ b/TelepathyQt4/Client/file-transfer.h
@@ -48,8 +48,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<FileTransfer> FileTransferPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/room-list.h b/TelepathyQt4/Client/room-list.h
index 5bd8280..be1d8dd 100644
--- a/TelepathyQt4/Client/room-list.h
+++ b/TelepathyQt4/Client/room-list.h
@@ -48,8 +48,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<RoomList> RoomListPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/streamed-media-channel.h b/TelepathyQt4/Client/streamed-media-channel.h
index c5ed877..f5d2b90 100644
--- a/TelepathyQt4/Client/streamed-media-channel.h
+++ b/TelepathyQt4/Client/streamed-media-channel.h
@@ -27,6 +27,8 @@
 
 #include <TelepathyQt4/Client/Channel>
 #include <TelepathyQt4/Client/PendingOperation>
+#include <TelepathyQt4/Client/Types>
+#include <TelepathyQt4/SharedPtr>
 
 namespace Telepathy
 {
@@ -34,9 +36,7 @@ namespace Client
 {
 
 class StreamedMediaChannel;
-class MediaStream;
 
-typedef QExplicitlySharedDataPointer<MediaStream> MediaStreamPtr;
 typedef QList<MediaStreamPtr> MediaStreams;
 
 class PendingMediaStreams : public PendingOperation
@@ -72,7 +72,7 @@ private:
 
 class MediaStream : public QObject,
                     private ReadyObject,
-                    public QSharedData
+                    public SharedData
 {
     Q_OBJECT
     Q_DISABLE_COPY(MediaStream)
@@ -187,8 +187,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<StreamedMediaChannel> StreamedMediaChannelPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/text-channel.h b/TelepathyQt4/Client/text-channel.h
index 07c6093..7045e5a 100644
--- a/TelepathyQt4/Client/text-channel.h
+++ b/TelepathyQt4/Client/text-channel.h
@@ -139,8 +139,6 @@ private:
     Private *mPriv;
 };
 
-typedef QExplicitlySharedDataPointer<TextChannel> TextChannelPtr;
-
 } // Telepathy::Client
 } // Telepathy
 
diff --git a/TelepathyQt4/Client/types.h b/TelepathyQt4/Client/types.h
new file mode 100644
index 0000000..8351409
--- /dev/null
+++ b/TelepathyQt4/Client/types.h
@@ -0,0 +1,61 @@
+/*
+ * This file is part of TelepathyQt4
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _TelepathyQt4_cli_types_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_types_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/SharedPtr>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+class Account;
+class AccountManager;
+class Channel;
+class Connection;
+class ConnectionManager;
+class FileTransfer;
+class RoomList;
+class MediaStream;
+class StreamedMediaChannel;
+class TextChannel;
+
+typedef SharedPtr<Account> AccountPtr;
+typedef SharedPtr<AccountManager> AccountManagerPtr;
+typedef SharedPtr<Channel> ChannelPtr;
+typedef SharedPtr<Connection> ConnectionPtr;
+typedef SharedPtr<ConnectionManager> ConnectionManagerPtr;
+typedef SharedPtr<FileTransfer> FileTransferPtr;
+typedef SharedPtr<RoomList> RoomListPtr;
+typedef SharedPtr<MediaStream> MediaStreamPtr;
+typedef SharedPtr<StreamedMediaChannel> StreamedMediaChannelPtr;
+typedef SharedPtr<TextChannel> TextChannelPtr;
+
+} // Telepathy::Client
+} // Telepathy
+
+#endif
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index ec8428c..50157a1 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -179,6 +179,7 @@ tpqt4clientinclude_HEADERS = \
     Client/StatefulDBusProxy \
     Client/StreamedMediaChannel \
     Client/TextChannel \
+    Client/Types \
     Client/AccountInterface \
     Client/AccountManagerInterface \
     Client/ChannelInterface \
@@ -242,7 +243,8 @@ tpqt4clientinclude_HEADERS = \
     Client/room-list.h \
     Client/simple-pending-operations.h \
     Client/streamed-media-channel.h \
-    Client/text-channel.h
+    Client/text-channel.h \
+    Client/types.h
 
 nodist_geninclude_HEADERS = \
     _gen/cli-account.h \
-- 
1.5.6.5




More information about the telepathy-commits mailing list