QmlProject: Move RunConfigurationFactory close to RunConfiguration

No need to have a dozen lines of code in a separate translation
unit and more in line with what others do nowadays.

Change-Id: I765535d1484805bc3005fe23bfd4992a96a80e9c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2018-04-06 14:55:56 +02:00
parent ef79078db2
commit 11336fb604
4 changed files with 20 additions and 6 deletions

View File

@@ -10,7 +10,6 @@ HEADERS += qmlproject.h \
qmlprojectconstants.h \
qmlprojectnodes.h \
qmlprojectrunconfiguration.h \
qmlprojectrunconfigurationfactory.h \
qmlprojectmanager_global.h \
qmlprojectmanagerconstants.h \
qmlprojectrunconfigurationwidget.h
@@ -20,7 +19,6 @@ SOURCES += qmlproject.cpp \
qmlprojectplugin.cpp \
qmlprojectnodes.cpp \
qmlprojectrunconfiguration.cpp \
qmlprojectrunconfigurationfactory.cpp \
qmlprojectrunconfigurationwidget.cpp
RESOURCES += qmlproject.qrc

View File

@@ -23,7 +23,6 @@ QtcPlugin {
"qmlprojectnodes.cpp", "qmlprojectnodes.h",
"qmlprojectplugin.cpp", "qmlprojectplugin.h",
"qmlprojectrunconfiguration.cpp", "qmlprojectrunconfiguration.h",
"qmlprojectrunconfigurationfactory.cpp", "qmlprojectrunconfigurationfactory.h",
"qmlprojectrunconfigurationwidget.cpp", "qmlprojectrunconfigurationwidget.h"
]
}

View File

@@ -48,8 +48,6 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace QtSupport;
using namespace QmlProjectManager::Internal;
namespace QmlProjectManager {
const char M_CURRENT_FILE[] = "CurrentFile";
@@ -146,7 +144,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
{
return wrapWidget(new QmlProjectRunConfigurationWidget(this));
return wrapWidget(new Internal::QmlProjectRunConfigurationWidget(this));
}
Utils::OutputFormatter *QmlProjectRunConfiguration::createOutputFormatter() const
@@ -297,4 +295,14 @@ void QmlProjectRunConfiguration::updateEnabledState()
}
}
namespace Internal {
QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory()
: FixedRunConfigurationFactory(QmlProjectRunConfiguration::tr("QML Scene"), false)
{
registerRunConfiguration<QmlProjectRunConfiguration>(Constants::QML_SCENE_RC_ID);
addSupportedProjectType(QmlProjectManager::Constants::QML_PROJECT_ID);
}
} // namespace Internal
} // namespace QmlProjectManager

View File

@@ -86,4 +86,13 @@ private:
QString m_qmlViewerArgs;
};
namespace Internal {
class QmlProjectRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
{
public:
QmlProjectRunConfigurationFactory();
};
} // namespace Internal
} // namespace QmlProjectManager