forked from qt-creator/qt-creator
QmlProjectManager: Use setup pattern for QmlProjectRunConfiguration
Change-Id: Ib69a09c65a4755312663286fddbd891c4f7c49ce Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -102,7 +102,6 @@ static void clearAlwaysOpenWithMode()
|
|||||||
class QmlProjectPluginPrivate
|
class QmlProjectPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QmlProjectRunConfigurationFactory runConfigFactory;
|
|
||||||
QPointer<QMessageBox> lastMessageBox;
|
QPointer<QMessageBox> lastMessageBox;
|
||||||
QdsLandingPage *landingPage = nullptr;
|
QdsLandingPage *landingPage = nullptr;
|
||||||
QdsLandingPageWidget *landingPageWidget = nullptr;
|
QdsLandingPageWidget *landingPageWidget = nullptr;
|
||||||
@@ -274,6 +273,8 @@ private:
|
|||||||
|
|
||||||
void QmlProjectPlugin::initialize()
|
void QmlProjectPlugin::initialize()
|
||||||
{
|
{
|
||||||
|
setupQmlProjectRunConfiguration();
|
||||||
|
|
||||||
d = new QmlProjectPluginPrivate;
|
d = new QmlProjectPluginPrivate;
|
||||||
|
|
||||||
if (!qmlDesignerEnabled()) {
|
if (!qmlDesignerEnabled()) {
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
#include "qmlbuildsystem.h"
|
||||||
#include "qmlprojectrunconfiguration.h"
|
#include "qmlprojectrunconfiguration.h"
|
||||||
#include "qmlmainfileaspect.h"
|
#include "qmlmainfileaspect.h"
|
||||||
#include "qmlmultilanguageaspect.h"
|
#include "qmlmultilanguageaspect.h"
|
||||||
#include "qmlproject.h"
|
|
||||||
#include "qmlprojectmanagerconstants.h"
|
#include "qmlprojectmanagerconstants.h"
|
||||||
#include "qmlprojectmanagertr.h"
|
#include "qmlprojectmanagertr.h"
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/environmentaspect.h>
|
#include <projectexplorer/environmentaspect.h>
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -318,11 +320,20 @@ FilePath QmlProjectRunConfiguration::mainScript() const
|
|||||||
|
|
||||||
// QmlProjectRunConfigurationFactory
|
// QmlProjectRunConfigurationFactory
|
||||||
|
|
||||||
QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory()
|
class QmlProjectRunConfigurationFactory final : public FixedRunConfigurationFactory
|
||||||
: FixedRunConfigurationFactory(Tr::tr("QML Runtime"), false)
|
|
||||||
{
|
{
|
||||||
registerRunConfiguration<QmlProjectRunConfiguration>(Constants::QML_RUNCONFIG_ID);
|
public:
|
||||||
addSupportedProjectType(Constants::QML_PROJECT_ID);
|
QmlProjectRunConfigurationFactory()
|
||||||
|
: FixedRunConfigurationFactory(Tr::tr("QML Runtime"), false)
|
||||||
|
{
|
||||||
|
registerRunConfiguration<QmlProjectRunConfiguration>(Constants::QML_RUNCONFIG_ID);
|
||||||
|
addSupportedProjectType(Constants::QML_PROJECT_ID);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQmlProjectRunConfiguration()
|
||||||
|
{
|
||||||
|
static QmlProjectRunConfigurationFactory theQmlProjectRunConfigurationFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // QmlProjectManager::Internal
|
} // QmlProjectManager::Internal
|
||||||
|
@@ -3,16 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
namespace QmlProjectManager::Internal {
|
||||||
|
|
||||||
namespace QmlProjectManager {
|
void setupQmlProjectRunConfiguration();
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class QmlProjectRunConfigurationFactory final : public ProjectExplorer::FixedRunConfigurationFactory
|
} // QmlProjectManager::Internal
|
||||||
{
|
|
||||||
public:
|
|
||||||
QmlProjectRunConfigurationFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace QmlProjectManager
|
|
||||||
|
Reference in New Issue
Block a user