summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp')
-rw-r--r--src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp8
1 files changed, 4 insertions, 4 deletions
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