From bd307f397d2bc53f656e999da68c95917d714841 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Tue, 15 May 2012 15:52:26 +1000
Subject: [PATCH] Fixed -qtnamespace compilation issues.

Forward declaration of classes should come after QT_BEGIN_NAMESPACE, if
the declared classes are expected to be inside the qtnamespace.

Change-Id: Ifa7f2cbcd5ea9f5a0b2ade267c76d9e5e04d105a
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
---
 src/xmlpatterns/api/qdeviceresourceloader_p.h    | 6 +++---
 src/xmlpatterns/expr/qcalltargetdescription_p.h  | 6 +++---
 src/xmlpatterns/expr/quserfunction_p.h           | 4 ++--
 src/xmlpatterns/functions/qfunctionsignature_p.h | 6 +++---
 src/xmlpatterns/parser/qmaintainingreader_p.h    | 4 ++--
 src/xmlpatterns/schema/qxsdstatemachine_p.h      | 4 ++--
 src/xmlpatterns/schema/qxsduserschematype_p.h    | 6 +++---
 src/xmlpatterns/type/qlocalnametest_p.h          | 4 ++--
 src/xmlpatterns/type/qnamespacenametest_p.h      | 4 ++--
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/xmlpatterns/api/qdeviceresourceloader_p.h b/src/xmlpatterns/api/qdeviceresourceloader_p.h
index d819a6c1..3eae3f44 100644
--- a/src/xmlpatterns/api/qdeviceresourceloader_p.h
+++ b/src/xmlpatterns/api/qdeviceresourceloader_p.h
@@ -52,14 +52,14 @@
 #ifndef QPatternist_DeviceResourceLoader_p_H
 #define QPatternist_DeviceResourceLoader_p_H
 
-template<typename T> class QSet;
-class QUrl;
-
 #include <private/qresourceloader_p.h>
 
 QT_BEGIN_HEADER
 QT_BEGIN_NAMESPACE
 
+template<typename T> class QSet;
+class QUrl;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/expr/qcalltargetdescription_p.h b/src/xmlpatterns/expr/qcalltargetdescription_p.h
index 1922ea52..8cf03b3e 100644
--- a/src/xmlpatterns/expr/qcalltargetdescription_p.h
+++ b/src/xmlpatterns/expr/qcalltargetdescription_p.h
@@ -52,9 +52,6 @@
 #ifndef Patternist_CallTargetDescription_H
 #define Patternist_CallTargetDescription_H
 
-template<typename Key, typename Value> class QHash;
-template<typename T> class QList;
-
 #include <QSharedData>
 
 #include <private/qexpression_p.h>
@@ -63,6 +60,9 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename Key, typename Value> class QHash;
+template<typename T> class QList;
+
 namespace QPatternist
 {
     class CallSite;
diff --git a/src/xmlpatterns/expr/quserfunction_p.h b/src/xmlpatterns/expr/quserfunction_p.h
index c7281e46..eaa0895a 100644
--- a/src/xmlpatterns/expr/quserfunction_p.h
+++ b/src/xmlpatterns/expr/quserfunction_p.h
@@ -52,8 +52,6 @@
 #ifndef Patternist_UserFunction_H
 #define Patternist_UserFunction_H
 
-template<typename T> class QList;
-
 #include <QSharedData>
 
 #include <private/qexpression_p.h>
@@ -64,6 +62,8 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename T> class QList;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/functions/qfunctionsignature_p.h b/src/xmlpatterns/functions/qfunctionsignature_p.h
index 6e479502..9757d918 100644
--- a/src/xmlpatterns/functions/qfunctionsignature_p.h
+++ b/src/xmlpatterns/functions/qfunctionsignature_p.h
@@ -52,9 +52,6 @@
 #ifndef Patternist_FunctionSignature_H
 #define Patternist_FunctionSignature_H
 
-template<typename Key, typename Value> class QHash;
-template<typename T> class QList;
-
 #include <QSharedData>
 
 #include <private/qcalltargetdescription_p.h>
@@ -67,6 +64,9 @@ QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename Key, typename Value> class QHash;
+template<typename T> class QList;
+
 namespace QPatternist
 {
 
diff --git a/src/xmlpatterns/parser/qmaintainingreader_p.h b/src/xmlpatterns/parser/qmaintainingreader_p.h
index 7390a48f..f7ae407f 100644
--- a/src/xmlpatterns/parser/qmaintainingreader_p.h
+++ b/src/xmlpatterns/parser/qmaintainingreader_p.h
@@ -61,11 +61,11 @@
 #include <private/qxpathhelper_p.h>
 #include <private/qxslttokenlookup_p.h>
 
-class QUrl;
-
 QT_BEGIN_HEADER
 QT_BEGIN_NAMESPACE
 
+class QUrl;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_p.h b/src/xmlpatterns/schema/qxsdstatemachine_p.h
index bb405785..805d345c 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_p.h
@@ -58,12 +58,12 @@
 #include <QtCore/QSet>
 #include <QtCore/QTextStream>
 
-class QIODevice;
-
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+class QIODevice;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/schema/qxsduserschematype_p.h b/src/xmlpatterns/schema/qxsduserschematype_p.h
index 6a13f583..8c704416 100644
--- a/src/xmlpatterns/schema/qxsduserschematype_p.h
+++ b/src/xmlpatterns/schema/qxsduserschematype_p.h
@@ -56,13 +56,13 @@
 #include <private/qschematype_p.h>
 #include <private/qxsdannotated_p.h>
 
-template<typename N, typename M> class QHash;
-template<typename N> class QList;
-
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename N, typename M> class QHash;
+template<typename N> class QList;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/type/qlocalnametest_p.h b/src/xmlpatterns/type/qlocalnametest_p.h
index 331ef5c0..fc584104 100644
--- a/src/xmlpatterns/type/qlocalnametest_p.h
+++ b/src/xmlpatterns/type/qlocalnametest_p.h
@@ -54,12 +54,12 @@
 
 #include <private/qabstractnodetest_p.h>
 
-template<typename Key, typename Value> class QHash;
-
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename Key, typename Value> class QHash;
+
 namespace QPatternist
 {
     /**
diff --git a/src/xmlpatterns/type/qnamespacenametest_p.h b/src/xmlpatterns/type/qnamespacenametest_p.h
index 6c4fbb2f..4c08bec4 100644
--- a/src/xmlpatterns/type/qnamespacenametest_p.h
+++ b/src/xmlpatterns/type/qnamespacenametest_p.h
@@ -54,12 +54,12 @@
 
 #include <private/qabstractnodetest_p.h>
 
-template<typename Key, typename Value> class QHash;
-
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
 
+template<typename Key, typename Value> class QHash;
+
 namespace QPatternist
 {
     /**
-- 
GitLab