QmlDesigner: Fix compilation of coretests

Change-Id: Idd0c717078ac8d4fed9a8d4dfe000091ee2384c5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Thomas Hartmann
2020-08-17 10:54:44 +02:00
parent 3d68fa647c
commit 7856c2c2f0
3 changed files with 14 additions and 4 deletions

View File

@@ -27,7 +27,9 @@
#include "nodeinstanceserverproxy.h"
#include "nodeinstanceview.h"
#ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h>
#endif
#include <coreplugin/messagebox.h>
@@ -49,6 +51,7 @@ void InteractiveConnectionManager::setUp(NodeInstanceServerProxy *nodeInstanceSe
{
ConnectionManager::setUp(nodeInstanceServerProxy, qrcMappingString, target);
#ifndef QMLDESIGNER_TEST
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
int timeOutTime = settings.value(DesignerSettingsKey::PUPPET_KILL_TIMEOUT).toInt();
for (Connection &connection : m_connections)
@@ -65,6 +68,7 @@ void InteractiveConnectionManager::setUp(NodeInstanceServerProxy *nodeInstanceSe
});
}
}
#endif
}
void InteractiveConnectionManager::showCannotConnectToPuppetWarningAndSwitchToEditMode()
@@ -74,9 +78,11 @@ void InteractiveConnectionManager::showCannotConnectToPuppetWarningAndSwitchToEd
tr("The executable of the QML emulation layer (QML Puppet) may not be responding. "
"Switching to another kit might help."));
#ifndef QMLDESIGNER_TEST
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
nodeInstanceServerProxy()->nodeInstanceView()->emitDocumentMessage(
tr("Cannot Connect to QML Emulation Layer (QML Puppet)"));
#endif
}
void InteractiveConnectionManager::dispatchCommand(const QVariant &command, Connection &connection)

View File

@@ -83,12 +83,11 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/documentmanager.h>
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
#endif
#include <projectexplorer/target.h>
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -552,8 +551,10 @@ void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node,
}
} else if (node.isRootNode() && name == "language@Internal") {
const QString languageAsString = value.toString();
#ifndef QMLDESIGNER_TEST
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current(m_currentTarget))
multiLanguageAspect->setCurrentLocale(languageAsString);
#endif
m_nodeInstanceServer->changeLanguage({languageAsString});
} else if (node.isRootNode() && name == "previewSize@Internal") {
m_nodeInstanceServer->changePreviewImageSize(value.toSize());
@@ -992,8 +993,10 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
}
QString lastUsedLanguage;
#ifndef QMLDESIGNER_TEST
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current(m_currentTarget))
lastUsedLanguage = multiLanguageAspect->currentLocale();
#endif
return CreateSceneCommand(
instanceContainerList,

View File

@@ -30,6 +30,7 @@
#include <model.h>
#ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h>
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
#endif
#include <nodeinstanceview.h>
@@ -45,8 +46,6 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -521,10 +520,12 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
customFileSelectors = m_target->additionalData("CustomFileSelectorsData").toStringList();
#ifndef QMLDESIGNER_TEST
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current(m_target)) {
if (!multiLanguageAspect->databaseFilePath().isEmpty())
environment.set("QT_MULTILANGUAGE_DATABASE", multiLanguageAspect->databaseFilePath().toString());
}
#endif
}
customFileSelectors.append("DesignMode");