diff generator/cppimplgenerator.cpp @ 20:deb0cc1d053d

fix for QByteArray.at
author eldar
date Thu, 14 May 2009 19:52:54 +0000
parents e78566595089
children e747af2e6b46
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";