[Telepathy-commits] [telepathy-qt4/master] Reduce inclusions into channel.h via forward declarations

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Jan 5 09:57:34 PST 2009


channel.h only mentions Connection or QDBusPendingCallWatcher via a
pointer, so it can just forward-declare those classes.

Also compensate for this in channel.cpp and pending-channel.cpp,
remove redundant inclusion of dbus.h in channel.cpp, and check
self-containedness of the public header rather than channel.h.
---
 TelepathyQt4/Client/channel.cpp         |    8 ++++----
 TelepathyQt4/Client/channel.h           |    6 ++++--
 TelepathyQt4/Client/pending-channel.cpp |    1 +
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/TelepathyQt4/Client/channel.cpp b/TelepathyQt4/Client/channel.cpp
index 8d26e50..f0e499c 100644
--- a/TelepathyQt4/Client/channel.cpp
+++ b/TelepathyQt4/Client/channel.cpp
@@ -19,16 +19,16 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#define IN_TELEPATHY_QT4_HEADER
-#include "channel.h"
-#include "channel.moc.hpp"
+#include <TelepathyQt4/Client/Channel>
 
-#include "dbus.h"
+#include "channel.moc.hpp"
 
 #include <TelepathyQt4/_gen/cli-channel-body.hpp>
 #include <TelepathyQt4/_gen/cli-channel.moc.hpp>
 
+#include <TelepathyQt4/Client/Connection>
 #include <TelepathyQt4/Constants>
+
 #include <TelepathyQt4/debug-internal.h>
 
 #include <QQueue>
diff --git a/TelepathyQt4/Client/channel.h b/TelepathyQt4/Client/channel.h
index 369753a..9850478 100644
--- a/TelepathyQt4/Client/channel.h
+++ b/TelepathyQt4/Client/channel.h
@@ -47,19 +47,21 @@
 
 #include <TelepathyQt4/_gen/cli-channel.h>
 
-#include <TelepathyQt4/Client/Connection>
 #include <TelepathyQt4/Client/DBus>
 #include <TelepathyQt4/Client/DBusProxy>
 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
 
 #include <QSet>
-#include <QDBusPendingCallWatcher>
+
+class QDBusPendingCallWatcher;
 
 namespace Telepathy
 {
 namespace Client
 {
 
+class Connection;
+
 /**
  * \class Channel
  * \ingroup clientchannel
diff --git a/TelepathyQt4/Client/pending-channel.cpp b/TelepathyQt4/Client/pending-channel.cpp
index 2f97080..245a54a 100644
--- a/TelepathyQt4/Client/pending-channel.cpp
+++ b/TelepathyQt4/Client/pending-channel.cpp
@@ -24,6 +24,7 @@
 #include "pending-channel.moc.hpp"
 
 #include <TelepathyQt4/Client/Channel>
+#include <TelepathyQt4/Client/Connection>
 #include <TelepathyQt4/debug-internal.h>
 
 namespace Telepathy
-- 
1.5.6.5




More information about the Telepathy-commits mailing list