Переглянути джерело

Fix QML GRPC functions generator template

Giulio Girardi 4 роки тому
батько
коміт
605e1008b9
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      src/generator/templates.cpp

+ 2 - 2
src/generator/templates.cpp

@@ -317,7 +317,7 @@ const char *Templates::ClientMethodDefinitionQmlTemplate = "\nvoid $classname$::
                                                            "        return;\n"
                                                            "    }\n\n"
                                                            "    if (arg == nullptr) {\n"
-                                                           "        qProtoWarning() << \"Invalid argument provided for method $classname$::$method_name$, argument of type 'qtprotobufnamespace::tests::SimpleStringMessage *' expected\";\n"
+                                                           "        qProtoWarning() << \"Invalid argument provided for method $classname$::$method_name$, argument of type '$param_type$ *' expected\";\n"
                                                            "        return;\n"
                                                            "    }\n\n"
                                                            "    QJSEngine *jsEngine = qjsEngine(this);\n"
@@ -327,7 +327,7 @@ const char *Templates::ClientMethodDefinitionQmlTemplate = "\nvoid $classname$::
                                                            "    }\n\n"
                                                            "    QtProtobuf::QGrpcAsyncReply *reply = call(\"$method_name$\", *$param_name$);\n"
                                                            "    reply->subscribe(jsEngine, [this, reply, callback, jsEngine]() {\n"
-                                                           "        auto result = new $param_type$(reply->read<$param_type$>());\n"
+                                                           "        auto result = new $return_type$(reply->read<$return_type$>());\n"
                                                            "        qmlEngine(this)->setObjectOwnership(result, QQmlEngine::JavaScriptOwnership);\n"
                                                            "        QJSValue(callback).call(QJSValueList{jsEngine->toScriptValue(result)});\n"
                                                            "    }, [errorCallback, jsEngine](const QGrpcStatus &status) {\n"