summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Craig <ext-chris.craig@nokia.com>2012-02-13 17:36:44 -0500
committerAndrew Christian <andrew.christian@nokia.com>2012-02-14 12:57:25 +0100
commitec24141346da96e4546d991f5e154bb9ab904022 (patch)
tree876cb2cbe9320d71274dba0e1871fbbb7af0822d /src
parentb0c89c48d416b829ce4b6bb91746ddf29fc6915d (diff)
Fix broken metatype registration using namespace macros
The compiler will not correctly expand this: Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend) *) so we add an extra level of indirection so the correct expanded typename is processed by Q_DECLARE_METATYPE. Change-Id: Ic7fa033f370844fe7fdb1dda4451bf3264769e8d Reviewed-by: Jani Uusi-Rantala <jani.uusi-rantala@nokia.com> Reviewed-by: Andrew Christian <andrew.christian@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/processbackend.h2
-rw-r--r--src/core/processfrontend.h4
-rw-r--r--src/core/processinfo.h2
-rw-r--r--src/core/processmanager-global.h7
4 files changed, 11 insertions, 4 deletions
diff --git a/src/core/processbackend.h b/src/core/processbackend.h
index eb87fa7..4a72fda 100644
--- a/src/core/processbackend.h
+++ b/src/core/processbackend.h
@@ -112,6 +112,6 @@ protected:
QT_END_NAMESPACE_PROCESSMANAGER
-Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessBackend)*)
+QT_PROCESSMANAGER_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessBackend) *)
#endif // PROCESS_BACKEND_H
diff --git a/src/core/processfrontend.h b/src/core/processfrontend.h
index 542bbd9..0cf6712 100644
--- a/src/core/processfrontend.h
+++ b/src/core/processfrontend.h
@@ -140,7 +140,7 @@ private:
QT_END_NAMESPACE_PROCESSMANAGER
-Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend)*)
-Q_DECLARE_METATYPE(const QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend)*)
+QT_PROCESSMANAGER_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend) *)
+QT_PROCESSMANAGER_DECLARE_METATYPE(const QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend) *)
#endif // PROCESS_FRONTEND_H
diff --git a/src/core/processinfo.h b/src/core/processinfo.h
index ae8c76c..4af87c0 100644
--- a/src/core/processinfo.h
+++ b/src/core/processinfo.h
@@ -144,6 +144,6 @@ private:
QT_END_NAMESPACE_PROCESSMANAGER
-Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessInfo)*)
+QT_PROCESSMANAGER_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessInfo) *)
#endif // PROCESSINFO_H
diff --git a/src/core/processmanager-global.h b/src/core/processmanager-global.h
index 34a6144..1fe2676 100644
--- a/src/core/processmanager-global.h
+++ b/src/core/processmanager-global.h
@@ -61,6 +61,13 @@
# define QT_PREPEND_NAMESPACE_PROCESSMANAGER(name) ::QtAddOn::ProcessManager::name
#endif
+// The compiler will not correctly expand this:
+// Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE_PROCESSMANAGER(ProcessFrontend) *)
+// so we add an extra level of indirection so the correct expanded typename is processed
+// by Q_DECLARE_METATYPE.
+#define QT_PROCESSMANAGER_DECLARE_METATYPE(TYPE) \
+ Q_DECLARE_METATYPE(TYPE)
+
// a workaround for moc - if there is a header file that doesn't use processmanager
// namespace, we still force moc to do "using namespace" but the namespace have to
// be defined, so let's define an empty namespace here