[Development] Header diff for QtDBus

Thiago Macieira thiago.macieira at intel.com
Wed Jun 26 22:49:38 CEST 2013


diff --git a/src/dbus/qdbusabstractadaptor.h b/src/dbus/qdbusabstractadaptor.h
index 6897339..2a32344 100644
--- a/src/dbus/qdbusabstractadaptor.h
+++ b/src/dbus/qdbusabstractadaptor.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -72,8 +70,6 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 
 #endif
diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h
index e757013..8f014ce 100644
--- a/src/dbus/qdbusabstractinterface.h
+++ b/src/dbus/qdbusabstractinterface.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -53,8 +53,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -161,7 +159,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 9687f21..a3a6f99 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -55,8 +55,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -397,10 +395,25 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantHash &map)
     return arg;
 }
 
+template <typename T1, typename T2>
+inline QDBusArgument &operator<<(QDBusArgument &arg, const QPair<T1, T2> &pair)
+{
+    arg.beginStructure();
+    arg << pair.first << pair.second;
+    arg.endStructure();
+    return arg;
+}
 
-QT_END_NAMESPACE
+template <typename T1, typename T2>
+inline const QDBusArgument &operator>>(const QDBusArgument &arg, QPair<T1, T2> &pair)
+{
+    arg.beginStructure();
+    arg >> pair.first >> pair.second;
+    arg.endStructure();
+    return arg;
+}
 
-QT_END_HEADER
+QT_END_NAMESPACE
 
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index b580006..20a579f 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -208,7 +206,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::VirtualObjectRegisterOptions)
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h
index a174c7e..b900d2a 100644
--- a/src/dbus/qdbusconnectioninterface.h
+++ b/src/dbus/qdbusconnectioninterface.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -49,8 +49,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -125,7 +123,5 @@ QT_END_NAMESPACE
 
 Q_DECLARE_BUILTIN_METATYPE(UInt, QMetaType::UInt, QDBusConnectionInterface::RegisterServiceReply)
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h
index 3ff1bbe..82dc778 100644
--- a/src/dbus/qdbuscontext.h
+++ b/src/dbus/qdbuscontext.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -80,7 +78,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h
index 1bed785..2c4ec6c 100644
--- a/src/dbus/qdbuserror.h
+++ b/src/dbus/qdbuserror.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 struct DBusError;
 
 QT_BEGIN_NAMESPACE
@@ -129,7 +127,5 @@ QT_END_NAMESPACE
 
 Q_DECLARE_METATYPE(QDBusError)
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index 60ac5a6..ba99d45 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -51,8 +51,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -177,7 +175,5 @@ Q_DECLARE_METATYPE(QDBusVariant)
 Q_DECLARE_METATYPE(QDBusObjectPath)
 Q_DECLARE_METATYPE(QDBusSignature)
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusinterface.h b/src/dbus/qdbusinterface.h
index a252641..d2bb1da 100644
--- a/src/dbus/qdbusinterface.h
+++ b/src/dbus/qdbusinterface.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -75,7 +73,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusmacros.h b/src/dbus/qdbusmacros.h
index 9a947bd..5a95f53 100644
--- a/src/dbus/qdbusmacros.h
+++ b/src/dbus/qdbusmacros.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -57,7 +57,6 @@
 #include <QtCore/qvector.h>
 #endif
 
-QT_BEGIN_HEADER
 QT_BEGIN_NAMESPACE
 
 #ifndef QT_NO_DBUS
@@ -75,6 +74,5 @@ QT_BEGIN_NAMESPACE
 #endif // QT_NO_DBUS
 
 QT_END_NAMESPACE
-QT_END_HEADER
 
 #endif
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index 386078d..8f8954c 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -49,7 +49,9 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
+#if defined(Q_OS_WIN) && defined(interface)
+#  undef interface
+#endif
 
 QT_BEGIN_NAMESPACE
 
@@ -126,8 +128,6 @@ QT_END_NAMESPACE
 
 Q_DECLARE_METATYPE(QDBusMessage)
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
 
diff --git a/src/dbus/qdbusmetatype.h b/src/dbus/qdbusmetatype.h
index 6db4ff2..bc556a0 100644
--- a/src/dbus/qdbusmetatype.h
+++ b/src/dbus/qdbusmetatype.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -76,7 +74,7 @@ void qDBusDemarshallHelper(const QDBusArgument &arg, T *t)
 
 template<typename T>
 int qDBusRegisterMetaType(
-#ifndef qdoc
+#ifndef Q_QDOC
     T * /* dummy */ = 0
 #endif
 )
@@ -93,7 +91,5 @@ int qDBusRegisterMetaType(
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index 4ef0931..19bc34c 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -51,8 +51,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -122,7 +120,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h
index 47a8236..b7e459f 100644
--- a/src/dbus/qdbuspendingreply.h
+++ b/src/dbus/qdbuspendingreply.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -49,8 +49,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -107,6 +105,10 @@ namespace QDBusPendingReplyTypes {
         static inline void fillMetaTypes(int *)
         { }
     };
+
+    struct TypeIsVoid {};
+    template <typename T> struct NotVoid       { typedef T Type; };
+    template <>           struct NotVoid<void> { typedef TypeIsVoid Type; };
 } // namespace QDBusPendingReplyTypes
 
 template<typename T1 = void, typename T2 = void, typename T3 = void, typename T4 = void,
@@ -168,9 +170,7 @@ public:
     template<int Index> inline
     const typename Select<Index>::Type argumentAt() const
     {
-        // static assert?
-        Q_ASSERT_X(Index < count() && Index >= 0, "QDBusPendingReply::argumentAt",
-                   "Index out of bounds");
+        Q_STATIC_ASSERT_X(Index >= 0 && Index < Count, "Index out of bounds");
         typedef typename Select<Index>::Type ResultType;
         return qdbus_cast<ResultType>(argumentAt(Index), 0);
     }
@@ -180,7 +180,7 @@ public:
         return argumentAt<0>();
     }
 
-    inline operator typename Select<0>::Type() const
+    inline operator typename QDBusPendingReplyTypes::NotVoid<T1>::Type() const
     {
         return argumentAt<0>();
     }
@@ -210,7 +210,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index 1d06540..4567c80 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -53,8 +53,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -71,7 +69,7 @@ public:
     }
     inline QDBusReply& operator=(const QDBusMessage &reply)
     {
-        QVariant data(qMetaTypeId(&m_data), reinterpret_cast<void*>(0));
+        QVariant data(qMetaTypeId<Type>(), reinterpret_cast<void*>(0));
         qDBusReplyFill(reply, m_error, data);
         m_data = qvariant_cast<Type>(data);
         return *this;
@@ -113,6 +111,7 @@ public:
     inline bool isValid() const { return !m_error.isValid(); }
 
     inline const QDBusError& error() { return m_error; }
+    inline const QDBusError& error() const { return m_error; }
 
     inline Type value() const
     {
@@ -184,6 +183,7 @@ public:
     inline bool isValid() const { return !m_error.isValid(); }
 
     inline const QDBusError& error() { return m_error; }
+    inline const QDBusError& error() const { return m_error; }
 
 private:
     QDBusError m_error;
@@ -192,7 +192,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusserver.h b/src/dbus/qdbusserver.h
index b444923..d455f8e 100644
--- a/src/dbus/qdbusserver.h
+++ b/src/dbus/qdbusserver.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -78,7 +76,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif
diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h
index 0e77f55..0988d82 100644
--- a/src/dbus/qdbusservicewatcher.h
+++ b/src/dbus/qdbusservicewatcher.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,8 +47,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -99,7 +97,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusServiceWatcher::WatchMode)
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif // QDBUSSERVICEWATCHER_H
diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h
index 15d3414..e8746fe 100644
--- a/src/dbus/qdbusunixfiledescriptor.h
+++ b/src/dbus/qdbusunixfiledescriptor.h
@@ -1,9 +1,9 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
-** This file is part of the FOO module of the Qt Toolkit.
+** This file is part of the QtDBus module of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
 ** Commercial License Usage
@@ -52,8 +52,6 @@
 # include <utility>
 #endif
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -97,7 +95,5 @@ QT_END_NAMESPACE
 
 Q_DECLARE_METATYPE(QDBusUnixFileDescriptor)
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif // QDBUSUNIXFILEDESCRIPTOR_H
diff --git a/src/dbus/qdbusvirtualobject.h b/src/dbus/qdbusvirtualobject.h
index 4c0bf7f..da63082 100644
--- a/src/dbus/qdbusvirtualobject.h
+++ b/src/dbus/qdbusvirtualobject.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
 ** Contact: http://www.qt-project.org/legal
 **
 ** This file is part of the QtDBus module of the Qt Toolkit.
@@ -48,8 +48,6 @@
 
 #ifndef QT_NO_DBUS
 
-QT_BEGIN_HEADER
-
 QT_BEGIN_NAMESPACE
 
 
@@ -74,7 +72,5 @@ private:
 
 QT_END_NAMESPACE
 
-QT_END_HEADER
-
 #endif // QT_NO_DBUS
 #endif



More information about the Development mailing list