forked from qt-creator/qt-creator
ProjectExplorer: De-qobject-ify RunConfigurationFactory
Some translations moved over to the corresponding RunConfigurations, one setParent() replaced by direct deletion. Change-Id: Ib5e527b71353a6be70b332ac2dfd2f5cd2499a60 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -62,8 +62,6 @@ private:
|
||||
|
||||
class CMakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CMakeRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -303,7 +303,7 @@ Abi CustomExecutableRunConfiguration::abi() const
|
||||
// Factory
|
||||
|
||||
CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory() :
|
||||
FixedRunConfigurationFactory(tr("Custom Executable"))
|
||||
FixedRunConfigurationFactory(CustomExecutableRunConfiguration::tr("Custom Executable"))
|
||||
{
|
||||
registerRunConfiguration<CustomExecutableRunConfiguration>(CUSTOM_EXECUTABLE_ID);
|
||||
}
|
||||
|
@@ -86,8 +86,6 @@ private:
|
||||
|
||||
class CustomExecutableRunConfigurationFactory : public FixedRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomExecutableRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -466,10 +466,10 @@ QString RunConfigurationFactory::decoratedTargetName(const QString targetName, T
|
||||
if (IDevice::ConstPtr dev = DeviceKitInformation::device(target->kit())) {
|
||||
if (displayName.isEmpty()) {
|
||||
//: Shown in Run configuration if no executable is given, %1 is device name
|
||||
displayName = tr("Run on %1").arg(dev->displayName());
|
||||
displayName = RunConfiguration::tr("Run on %1").arg(dev->displayName());
|
||||
} else {
|
||||
//: Shown in Run configuration, Add menu: "name of runnable (on device name)"
|
||||
displayName = tr("%1 (on %2)").arg(displayName, dev->displayName());
|
||||
displayName = RunConfiguration::tr("%1 (on %2)").arg(displayName, dev->displayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -310,13 +310,11 @@ public:
|
||||
bool useTerminal = false;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT RunConfigurationFactory : public QObject
|
||||
class PROJECTEXPLORER_EXPORT RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RunConfigurationFactory();
|
||||
~RunConfigurationFactory();
|
||||
virtual ~RunConfigurationFactory();
|
||||
|
||||
static const QList<RunConfigurationFactory *> allRunConfigurationFactories();
|
||||
|
||||
@@ -346,6 +344,9 @@ protected:
|
||||
void setDecorateDisplayNames(bool on);
|
||||
|
||||
private:
|
||||
RunConfigurationFactory(const RunConfigurationFactory &) = delete;
|
||||
RunConfigurationFactory operator=(const RunConfigurationFactory &) = delete;
|
||||
|
||||
bool canHandle(Target *target) const;
|
||||
|
||||
friend class RunConfigurationCreationInfo;
|
||||
@@ -358,8 +359,6 @@ private:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT FixedRunConfigurationFactory : public RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FixedRunConfigurationFactory(const QString &displayName,
|
||||
bool addDeviceName = false);
|
||||
|
@@ -116,8 +116,6 @@ private:
|
||||
|
||||
class DesktopQmakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DesktopQmakeRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -41,14 +41,14 @@ namespace Internal {
|
||||
|
||||
QmlProjectPlugin::~QmlProjectPlugin()
|
||||
{
|
||||
delete m_rcFactory;
|
||||
}
|
||||
|
||||
bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(errorMessage)
|
||||
|
||||
auto rcFactory = new QmlProjectRunConfigurationFactory;
|
||||
rcFactory->setParent(this);
|
||||
m_rcFactory = new QmlProjectRunConfigurationFactory;
|
||||
|
||||
ProjectManager::registerProjectType<QmlProject>(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
|
||||
Core::FileIconProvider::registerIconOverlayForSuffix(":/qmlproject/images/qmlproject.png", "qmlproject");
|
||||
|
@@ -42,6 +42,8 @@ public:
|
||||
private:
|
||||
bool initialize(const QStringList &arguments, QString *errorString) final;
|
||||
void extensionsInitialized() final {}
|
||||
|
||||
class QmlProjectRunConfigurationFactory *m_rcFactory = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -32,7 +32,7 @@ namespace QmlProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory() :
|
||||
ProjectExplorer::FixedRunConfigurationFactory(tr("QML Scene"), false)
|
||||
ProjectExplorer::FixedRunConfigurationFactory(QmlProjectRunConfiguration::tr("QML Scene"), false)
|
||||
{
|
||||
registerRunConfiguration<QmlProjectRunConfiguration>(Constants::QML_SCENE_RC_ID);
|
||||
addSupportedProjectType(QmlProjectManager::Constants::QML_PROJECT_ID);
|
||||
|
@@ -32,8 +32,6 @@ namespace Internal {
|
||||
|
||||
class QmlProjectRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QmlProjectRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -49,7 +49,6 @@ private:
|
||||
|
||||
class QnxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QnxRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -63,8 +63,6 @@ private:
|
||||
|
||||
class RemoteLinuxCustomRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RemoteLinuxCustomRunConfigurationFactory();
|
||||
};
|
||||
|
@@ -84,8 +84,6 @@ private:
|
||||
|
||||
class RemoteLinuxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RemoteLinuxRunConfigurationFactory();
|
||||
};
|
||||
|
Reference in New Issue
Block a user