changeset 403:8564ab82ea42

merge
author Eldar Insafutdinov
date Thu, 17 Mar 2011 19:46:11 +0000
parents e67ce7c21758 (current diff) 827147052d8d (diff)
children b64ca517a6b7 778ef7374fb5
files cmake/FindD.cmake d2/qtd/Signal.d
diffstat 4 files changed, 35 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/cmake/FindD.cmake	Thu Mar 17 19:45:42 2011 +0000
+++ b/cmake/FindD.cmake	Thu Mar 17 19:46:11 2011 +0000
@@ -44,7 +44,7 @@
     endif(dmd_version)
     message(STATUS "D compiler found -- ${D_COMPILER_NAME} v${D_VERSION}.${D_FRONTEND}")
 else (DC)
-    message(FATAL_ERROR "D compliler is not found")
+    message(FATAL_ERROR "D compiler is not found")
 endif (DC)
 
 ## Get D compiler path.
--- a/d2/qt/core/QModelIndex.d	Thu Mar 17 19:45:42 2011 +0000
+++ b/d2/qt/core/QModelIndex.d	Thu Mar 17 19:46:11 2011 +0000
@@ -18,67 +18,65 @@
          return mi;
     }
 
-    public final QModelIndex child(int row, int column) {
-        return __qtd_QModelIndex_child_int_int(&this, row, column);
+    public final QModelIndex child(int row, int column) const {
+        return __qtd_QModelIndex_child_int_int(cast(void*)&this, row, column);
     }
 
     public final int column() const {
         return __qtd_QModelIndex_column(cast(void*)&this);
     }
 
-    public final QVariant data(int role = 0) {
-        void* __qt_return_value = __qtd_QModelIndex_data_int(&this, role);
+    public final QVariant data(int role = 0) const {
+        void* __qt_return_value = __qtd_QModelIndex_data_int(cast(void*)&this, role);
         return new QVariant(__qt_return_value);
     }
 
-    public final int flags() {
-        return __qtd_QModelIndex_flags(&this);
+    public final int flags() const {
+        return __qtd_QModelIndex_flags(cast(void*)&this);
     }
 
-    public final long internalId() {
-        return __qtd_QModelIndex_internalId(&this);
+    public final long internalId() const {
+        return __qtd_QModelIndex_internalId(cast(void*)&this);
     }
 
-    public final void* internalPointer() const {
-        //return __qtd_QModelIndex_internalPointer(&this);
-        return cast(void*)p;
+    public final const(void*) internalPointer() const {
+        return p;
     }
 
-    public final Object object() const {
-        return cast(Object) p;
+    public final const(Object) object() const {
+        return cast(const(Object)) p;
     }
 
     public final bool isValid() const {
         return __qtd_QModelIndex_isValid(cast(void*)&this);
     }
 
-    public final QAbstractItemModel model() {
-//        void* __qt_return_value = __qtd_QModelIndex_model(&this);
-        void* __qt_return_value = m;
-        if (__qt_return_value is null)
+    public final const(QAbstractItemModel) model() const {
+        void* __qt_return_value = cast(void*)m;
+        if (m is null)
             return null;
-        void* d_obj = qtd_get_d_qobject(__qt_return_value);
+        void* d_obj = qtd_get_d_qobject(cast(void*)m);
         return cast(QAbstractItemModel) d_obj;
     }
 
-    private final bool operator_less(QModelIndex other) {
-        return __qtd_QModelIndex_operator_less_QModelIndex(&this, other);
+    private final bool operator_less(QModelIndex other) const {
+        return __qtd_QModelIndex_operator_less_QModelIndex(cast(void*)&this, other);
     }
 
-    private final bool operator_equal(QModelIndex other) {
-        return __qtd_QModelIndex_operator_equal_QModelIndex(&this, other);
+    private final bool operator_equal(QModelIndex other) const {
+        return __qtd_QModelIndex_operator_equal_QModelIndex(cast(void*)&this, other);
     }
 
-    public final QModelIndex parent() {
-        return __qtd_QModelIndex_parent(&this);
+    public final QModelIndex parent() const {
+        return __qtd_QModelIndex_parent(cast(void*)&this);
     }
 
     public final int row() const {
         return __qtd_QModelIndex_row(cast(void*)&this);
     }
 
-    public final QModelIndex sibling(int row, int column) {
-        return __qtd_QModelIndex_sibling_int_int(&this, row, column);
+    public final QModelIndex sibling(int row, int column) const {
+        return __qtd_QModelIndex_sibling_int_int(cast(void*)&this, row, column);
     }
 
     public alias void __isNativeValueType;
--- a/d2/qtd/Signal.d	Thu Mar 17 19:45:42 2011 +0000
+++ b/d2/qtd/Signal.d	Thu Mar 17 19:46:11 2011 +0000
@@ -208,8 +208,7 @@
 string[] getSymbols(C)(string prefix)
 {
     string[] result;
-    auto allSymbols = __traits(derivedMembers, C);
-    foreach(s; allSymbols)
+    foreach(s; __traits(derivedMembers, C))
     {
         if(startsWith(s, prefix))
             result ~= s;
--- a/generator/CMakeLists.txt	Thu Mar 17 19:45:42 2011 +0000
+++ b/generator/CMakeLists.txt	Thu Mar 17 19:46:11 2011 +0000
@@ -200,6 +200,14 @@
 	OR NOT EXISTS ${jambi_inc})
     file(REMOVE ${dgen_build_conf})
     file(REMOVE ${jambi_inc})
+
+	# Explicitly include qglobal.h before all the »master includes« to make
+	# sure Q_CORE_EXPORT and other macros are already defined for all
+	# processed headers. Otherwise, the parser would choke on classes in files
+	# included before "qglobal.h" in <QtCore/QtCore> using one of these macros
+	# (e.g. QXmlStreamReader).
+	file(APPEND ${jambi_inc} "#include <${QT_QTCORE_INCLUDE_DIR}/qglobal.h>\n")
+
     file(APPEND ${dgen_build_conf} "<typesystem>\n")
     foreach(package_normal ${packages})
     	string(TOLOWER ${package_normal} package)
@@ -233,7 +241,7 @@
 set(d_inc_file_found 1)
 
 foreach(path ${QT_INCLUDES})
-    set(inc_paths_tmp ${path}${sep})
+    set(inc_paths_tmp ${path}${sep}${inc_paths_tmp})
 endforeach()
 set(inc_paths ${inc_paths}${sep}${inc_paths_tmp})