changeset 20:deb0cc1d053d

fix for QByteArray.at
author eldar
date Thu, 14 May 2009 19:52:54 +0000
parents d54443f1ce1e
children e747af2e6b46
files generator/cppimplgenerator.cpp generator/typesystem_core.xml
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/generator/cppimplgenerator.cpp	Thu May 14 18:20:24 2009 +0000
+++ b/generator/cppimplgenerator.cpp	Thu May 14 19:52:54 2009 +0000
@@ -264,14 +264,19 @@
 
 QString CppImplGenerator::jniReturnName(const AbstractMetaFunction *java_function, uint options, bool d_export)
 {
-    QString return_type = translateType(java_function->type(), EnumAsInts, d_export);
+    AbstractMetaType *f_type = java_function->type();
+
+    QString return_type = translateType(f_type, EnumAsInts, d_export);
     QString new_return_type = java_function->typeReplaced(0);
     if (!new_return_type.isEmpty()) {
-        return_type = jniName(new_return_type);
+        if(f_type && f_type->isPrimitive()) {
+            if (d_export)
+                return_type = new_return_type;
+        } else
+            return_type = jniName(new_return_type);
     }
 
     // qtd
-    AbstractMetaType *f_type = java_function->type();
     if (f_type) {
         if (f_type->name() == "QModelIndex")
             return_type = "void";
--- a/generator/typesystem_core.xml	Thu May 14 18:20:24 2009 +0000
+++ b/generator/typesystem_core.xml	Thu May 14 19:52:54 2009 +0000
@@ -1183,7 +1183,13 @@
   <interface-type name="QFactoryInterface" java-name="QAbstractFactory"/>
 
   <value-type name="QByteArray">
-
+    
+    <modify-function signature="at(int)const">
+        <modify-argument index="return">
+            <replace-type modified-type="ubyte"/>
+        </modify-argument>
+    </modify-function>
+    
     <extra-includes>
         <include file-name="QNoImplicitBoolCast" location="global"/>
     </extra-includes>