Pass id to RunConfiguration constructor

It's what the base class requires, and opens the possibility to
have several factories creating the same type of run configuration.

Also move ios, winrt and android factories closer to their products,
it's the predominant pattern nowadays.

Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-04-25 10:26:08 +02:00
parent 4146a98599
commit 366be94ad9
49 changed files with 124 additions and 353 deletions

View File

@@ -11,7 +11,6 @@ HEADERS += \
iosconstants.h \
iosconfigurations.h \
iosrunconfiguration.h \
iosrunfactories.h \
iossettingspage.h \
iossettingswidget.h \
iosrunner.h \
@@ -41,7 +40,6 @@ HEADERS += \
SOURCES += \
iosconfigurations.cpp \
iosrunconfiguration.cpp \
iosrunfactories.cpp \
iossettingspage.cpp \
iossettingswidget.cpp \
iosrunner.cpp \

View File

@@ -55,8 +55,6 @@ QtcPlugin {
"iosqtversionfactory.h",
"iosrunconfiguration.cpp",
"iosrunconfiguration.h",
"iosrunfactories.cpp",
"iosrunfactories.h",
"iosrunner.cpp",
"iosrunner.h",
"iossettingspage.cpp",

View File

@@ -51,7 +51,5 @@ const quint16 IOS_SIMULATOR_PORT_END = 31000;
const char EXTRA_INFO_KEY[] = "extraInfo";
const char IOS_RC_ID_PREFIX[] = "Qt4ProjectManager.IosRunConfiguration:";
} // namespace Constants;
} // namespace Ios

View File

@@ -34,7 +34,6 @@
#include "iosdevicefactory.h"
#include "iosdsymbuildstep.h"
#include "iosqtversionfactory.h"
#include "iosrunfactories.h"
#include "iosrunner.h"
#include "iossettingspage.h"
#include "iossimulator.h"

View File

@@ -35,9 +35,12 @@
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
@@ -93,8 +96,8 @@ private:
QComboBox *m_deviceTypeComboBox;
};
IosRunConfiguration::IosRunConfiguration(Target *target)
: RunConfiguration(target, Constants::IOS_RC_ID_PREFIX)
IosRunConfiguration::IosRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id)
{
addExtraAspect(new ArgumentsAspect(this, "Ios.run_arguments"));
setOutputFormatter<QtSupport::QtOutputFormatter>();
@@ -419,5 +422,16 @@ void IosRunConfigurationWidget::updateValues()
m_executableLineEdit->setText(m_runConfiguration->localExecutable().toUserOutput());
}
// IosRunConfigurationFactory
IosRunConfigurationFactory::IosRunConfigurationFactory()
{
registerRunConfiguration<IosRunConfiguration>("Qt4ProjectManager.IosRunConfiguration:");
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
addSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
}
} // namespace Internal
} // namespace Ios

View File

@@ -44,7 +44,7 @@ class IosRunConfiguration : public ProjectExplorer::RunConfiguration
Q_OBJECT
public:
explicit IosRunConfiguration(ProjectExplorer::Target *target);
IosRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
QWidget *createConfigurationWidget() override;
IosDeployStep *deployStep() const;
@@ -74,5 +74,11 @@ private:
IosDeviceType m_deviceType;
};
class IosRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
{
public:
IosRunConfigurationFactory();
};
} // namespace Internal
} // namespace Ios

View File

@@ -1,45 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "iosrunfactories.h"
#include "iosconstants.h"
#include "iosrunconfiguration.h"
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
namespace Ios {
namespace Internal {
IosRunConfigurationFactory::IosRunConfigurationFactory()
{
registerRunConfiguration<IosRunConfiguration>(Constants::IOS_RC_ID_PREFIX);
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
addSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
}
} // namespace Internal
} // namespace Ios

View File

@@ -1,40 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/runconfiguration.h>
namespace Ios {
namespace Internal {
class IosRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
{
public:
IosRunConfigurationFactory();
};
} // namespace Internal
} // namespace Ios