diff options
Diffstat (limited to 'src')
4 files changed, 21 insertions, 7 deletions
diff --git a/src/plugins/qmlprojectmanager/CMakeLists.txt b/src/plugins/qmlprojectmanager/CMakeLists.txt index 3b7209d05c..21da457c21 100644 --- a/src/plugins/qmlprojectmanager/CMakeLists.txt +++ b/src/plugins/qmlprojectmanager/CMakeLists.txt @@ -6,7 +6,6 @@ add_qtc_plugin(QmlProjectManager SOURCES qmlprojectgen/qmlprojectgenerator.cpp qmlprojectgen/qmlprojectgenerator.h qmlprojectgen/templates.qrc - projectfilecontenttools.cpp projectfilecontenttools.h qdslandingpage.cpp qdslandingpage.h qdslandingpagetheme.cpp qdslandingpagetheme.h @@ -53,3 +52,17 @@ extend_qtc_plugin(QmlProjectManager generatecmakelistsconstants.h boilerplate.qrc ) + +add_qtc_library(QmlProjectManagerLib OBJECT + CONDITION Qt6_VERSION VERSION_GREATER_EQUAL 6.4.3 + EXCLUDE_FROM_INSTALL + DEPENDS + QmlJS Utils + INCLUDES + ${CMAKE_CURRENT_LIST_DIR} + SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/buildsystem + SOURCES + projectitem/filefilteritems.cpp projectitem/filefilteritems.h + projectitem/qmlprojectitem.cpp projectitem/qmlprojectitem.h + projectitem/converters.cpp projectitem/converters.h +) diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp index aa0abf8ffe..0097611a4d 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/converters.cpp @@ -337,7 +337,7 @@ QJsonObject qmlProjectTojson(const Utils::FilePath &projectFile) targetObject.insert("files", files); fileGroupsObject.insert(propsPair.first, targetObject); } else if (childNode->name().contains("shadertool", Qt::CaseInsensitive)) { - QStringList quotedArgs = childNode->property("args").value.toString().split('\"'); + QStringList quotedArgs = childNode->property("args").value.toString().split('\"', Qt::SkipEmptyParts); QStringList args; for (int i = 0; i < quotedArgs.size(); ++i) { // Each odd arg in this list is a single quoted argument, which we should diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp index 04bd26476e..5b56c8f37c 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp @@ -18,8 +18,9 @@ namespace QmlProjectManager { //#define REWRITE_PROJECT_FILE_IN_JSON_FORMAT -QmlProjectItem::QmlProjectItem(const Utils::FilePath &filePath) +QmlProjectItem::QmlProjectItem(const Utils::FilePath &filePath, const bool skipRewrite) : m_projectFile(filePath) + , m_skipRewrite(skipRewrite) { if (initProjectObject()) setupFileFilters(); @@ -394,9 +395,8 @@ void QmlProjectItem::addShaderToolFile(const QString &file) void QmlProjectItem::insertAndUpdateProjectFile(const QString &key, const QJsonValue &value) { m_project[key] = value; -#ifndef TESTS_ENABLED_QMLPROJECTITEM - m_projectFile.writeFileContents(Converters::jsonToQmlProject(m_project).toUtf8()); -#endif + if (!m_skipRewrite) + m_projectFile.writeFileContents(Converters::jsonToQmlProject(m_project).toUtf8()); } } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h index 78b038b037..83ef5ca000 100644 --- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h +++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h @@ -26,7 +26,7 @@ class QmlProjectItem : public QObject { Q_OBJECT public: - explicit QmlProjectItem(const Utils::FilePath &filePath); + explicit QmlProjectItem(const Utils::FilePath &filePath, const bool skipRewrite = false); bool isQt4McuProject() const; @@ -103,6 +103,7 @@ private: // runtime variables Utils::FilePath m_projectFile; // design studio project file QJsonObject m_project; // root project object + const bool m_skipRewrite; // initializing functions bool initProjectObject(); |