diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp index 98dd4cea983..7f01e33f435 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp @@ -156,7 +156,9 @@ QString jsonToQmlProject(const QJsonObject &rootObject) { // append ShaderTool object if (!shaderConfig["args"].toVariant().toStringList().isEmpty()) { startObject("ShaderTool"); - appendString("args", shaderConfig["args"].toVariant().toStringList().join(" ")); + appendString("args", + shaderConfig["args"].toVariant().toStringList().join(" ").replace( + "\"", "\\\"")); appendArray("files", shaderConfig["files"].toVariant().toStringList()); endObject(); } @@ -193,7 +195,7 @@ QJsonObject qmlProjectTojson(const Utils::FilePath &projectFile) } if (rootNode->name() != QLatin1String("Project")) { - qCritical() << "Cannot find root 'Proejct' item in the project file: " << projectFile; + qCritical() << "Cannot find root 'Project' item in the project file: " << projectFile; return {}; } diff --git a/tests/unit/unittest/qmlprojectmanager/converters-test.cpp b/tests/unit/unittest/qmlprojectmanager/converters-test.cpp index 4e4e225a890..b985fff53d3 100644 --- a/tests/unit/unittest/qmlprojectmanager/converters-test.cpp +++ b/tests/unit/unittest/qmlprojectmanager/converters-test.cpp @@ -31,12 +31,14 @@ public: ? QString::fromLatin1(m_qmlProjectFile.fileContents().value()) : QString{}); } + QString jsonToQmlProjectContent() const { return m_jsonToQmlProjectFile.fileContents() ? QString::fromLatin1(m_jsonToQmlProjectFile.fileContents().value()) : QString{}; } + QString qmlProjectToJsonContent() const { return m_qmlProjectToJsonFile.fileContents() @@ -45,9 +47,13 @@ public: } QString dataSetPath() const { return m_dataSetDirectory.absolutePath(); } + QString dataSetName() const { return m_dataSetDirectory.dirName(); } + Utils::FilePath qmlProjectFile() const { return m_qmlProjectFile; } + Utils::FilePath jsonToQmlProjectFile() const { return m_jsonToQmlProjectFile; } + Utils::FilePath qmlProjectToJsonFile() const { return m_qmlProjectToJsonFile; } private: diff --git a/tests/unit/unittest/qmlprojectmanager/data/converter/test-set-1/testfile.jsontoqml b/tests/unit/unittest/qmlprojectmanager/data/converter/test-set-1/testfile.jsontoqml index fe2c378c705..dbd6e4a91ac 100644 --- a/tests/unit/unittest/qmlprojectmanager/data/converter/test-set-1/testfile.jsontoqml +++ b/tests/unit/unittest/qmlprojectmanager/data/converter/test-set-1/testfile.jsontoqml @@ -28,7 +28,7 @@ Project { } ShaderTool { - args: "-s --glsl "100 es,120,150" --hlsl 50 --msl 12" + args: "-s --glsl \"100 es,120,150\" --hlsl 50 --msl 12" files: [ "content/shaders/*" ] }