forked from qt-creator/qt-creator
ProjectExplorer: Simplify collection of RunConfigurationCreationInfos
Instead of calling twice for AutoCreated and UserCreated, call once and record to which case it belongs. Only the 'both' and 'user only' combination are ever used. Change-Id: I9c15085bcbb4bf6584a6156135f2084dbfc51c1c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -48,9 +48,8 @@ BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *pare
|
||||
setSupportedTargetDeviceTypes({BareMetal::Constants::BareMetalOsType});
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo> BareMetalRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFactory::CreationMode mode) const
|
||||
QList<RunConfigurationCreationInfo> BareMetalRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &bti) {
|
||||
return convert(tr("%1 (on GDB server or hardware debugger)").arg(QFileInfo(bti.targetName).fileName()),
|
||||
bti.projectFilePath.toString() + '/' + bti.targetName);
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
explicit BareMetalRunConfigurationFactory(QObject *parent = nullptr);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
};
|
||||
|
||||
class BareMetalCustomRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
|
||||
|
@@ -239,10 +239,8 @@ CMakeRunConfigurationFactory::CMakeRunConfigurationFactory(QObject *parent) :
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
CMakeRunConfigurationFactory::availableCreators(Target *parent,
|
||||
IRunConfigurationFactory::CreationMode mode) const
|
||||
CMakeRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
||||
const QStringList titles = project->buildTargetTitles(true);
|
||||
return Utils::transform(titles, [this](const QString &title) { return convert(title, title); });
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
bool canCreateHelper(ProjectExplorer::Target *parent, const QString &suffix) const override;
|
||||
};
|
||||
|
||||
|
@@ -52,22 +52,11 @@ IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
IosRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
IosRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
auto project = static_cast<QmakeProject *>(parent->project());
|
||||
return Utils::transform(project->buildTargets(mode, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate}),
|
||||
[this](const BuildTargetInfo &ti) { return convert(ti); });
|
||||
}
|
||||
|
||||
bool IosRunConfigurationFactory::canCreateHelper(Target *parent, const QString &buildTarget) const
|
||||
{
|
||||
auto project = static_cast<QmakeProject *>(parent->project());
|
||||
const QList<BuildTargetInfo> buildTargets = project->buildTargets(UserCreate, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate});
|
||||
return Utils::contains(buildTargets, [buildTarget](const BuildTargetInfo &bti) {
|
||||
return bti.targetName == buildTarget;
|
||||
});
|
||||
return project->runConfigurationCreators(this, {ProjectType::ApplicationTemplate,
|
||||
ProjectType::SharedLibraryTemplate});
|
||||
}
|
||||
|
||||
bool IosRunConfigurationFactory::hasRunConfigForProFile(RunConfiguration *rc, const Utils::FileName &n) const
|
||||
|
@@ -44,9 +44,7 @@ public:
|
||||
explicit IosRunConfigurationFactory(QObject *parent = 0);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
|
||||
bool canCreateHelper(ProjectExplorer::Target *parent, const QString &suffix) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
|
||||
bool hasRunConfigForProFile(ProjectExplorer::RunConfiguration *rc, const Utils::FileName &n) const override;
|
||||
};
|
||||
|
@@ -449,9 +449,8 @@ const QList<IRunConfigurationFactory *> IRunConfigurationFactory::allRunConfigur
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
IRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFactory::CreationMode mode) const
|
||||
IRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &ti) {
|
||||
return RunConfigurationCreationInfo(this, m_runConfigBaseId, ti.targetName,
|
||||
QFileInfo(ti.targetName).completeBaseName());
|
||||
@@ -610,12 +609,9 @@ FixedRunConfigurationFactory::FixedRunConfigurationFactory(const QString &displa
|
||||
{ }
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
FixedRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
FixedRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
if (!canHandle(parent))
|
||||
return {};
|
||||
|
||||
Q_UNUSED(parent);
|
||||
return {RunConfigurationCreationInfo(this, runConfigurationBaseId(), QString(), m_fixedBuildTarget)};
|
||||
}
|
||||
|
||||
|
@@ -280,14 +280,22 @@ private:
|
||||
class RunConfigurationCreationInfo
|
||||
{
|
||||
public:
|
||||
RunConfigurationCreationInfo(const IRunConfigurationFactory *factory, Core::Id id,
|
||||
QString extra, QString displayName)
|
||||
: factory(factory) , id(id) , extra(extra) , displayName(displayName) {}
|
||||
enum CreationMode {AlwaysCreate, ManualCreationOnly};
|
||||
RunConfigurationCreationInfo(const IRunConfigurationFactory *factory,
|
||||
Core::Id id,
|
||||
QString extra, QString displayName,
|
||||
CreationMode creationMode = AlwaysCreate)
|
||||
: factory(factory), id(id),
|
||||
extra(extra),
|
||||
displayName(displayName),
|
||||
creationMode(creationMode)
|
||||
{}
|
||||
|
||||
const IRunConfigurationFactory *factory = nullptr;
|
||||
Core::Id id;
|
||||
QString extra;
|
||||
QString displayName;
|
||||
CreationMode creationMode = AlwaysCreate;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
|
||||
@@ -300,10 +308,7 @@ public:
|
||||
|
||||
static const QList<IRunConfigurationFactory *> allRunConfigurationFactories();
|
||||
|
||||
enum CreationMode {UserCreate, AutoCreate};
|
||||
|
||||
virtual QList<RunConfigurationCreationInfo> availableCreators(Target *parent,
|
||||
CreationMode mode = UserCreate) const;
|
||||
virtual QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const;
|
||||
|
||||
virtual bool canHandle(Target *target) const;
|
||||
|
||||
@@ -317,6 +322,8 @@ public:
|
||||
static IRunConfigurationFactory *find(Target *parent, RunConfiguration *rc);
|
||||
static QList<IRunConfigurationFactory *> find(Target *parent);
|
||||
|
||||
Core::Id runConfigurationBaseId() const { return m_runConfigBaseId; }
|
||||
|
||||
protected:
|
||||
virtual bool canCreateHelper(Target *parent, const QString &buildTarget) const;
|
||||
|
||||
@@ -333,8 +340,6 @@ protected:
|
||||
void setSupportedTargetDeviceTypes(const QList<Core::Id> &ids);
|
||||
void setDisplayNamePattern(const QString &pattern);
|
||||
|
||||
Core::Id runConfigurationBaseId() const { return m_runConfigBaseId; }
|
||||
|
||||
RunConfigurationCreationInfo convert(const BuildTargetInfo &ti) const;
|
||||
RunConfigurationCreationInfo convert(const QString &displayName, const QString &targetName = QString()) const;
|
||||
|
||||
@@ -352,8 +357,7 @@ class PROJECTEXPLORER_EXPORT FixedRunConfigurationFactory : public IRunConfigura
|
||||
public:
|
||||
explicit FixedRunConfigurationFactory(const QString &displayName, QObject *parent = nullptr);
|
||||
|
||||
QList<RunConfigurationCreationInfo> availableCreators(Target *parent,
|
||||
CreationMode mode = UserCreate) const override;
|
||||
QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const override;
|
||||
|
||||
private:
|
||||
const QString m_fixedBuildTarget;
|
||||
|
@@ -554,14 +554,19 @@ void Target::updateDefaultRunConfigurations()
|
||||
int configuredCount = existingConfigured.count();
|
||||
|
||||
// find all RC ids that can get created:
|
||||
QList<RunConfigurationCreationInfo> availableFactories;
|
||||
for (IRunConfigurationFactory *rcFactory : rcFactories)
|
||||
availableFactories.append(rcFactory->availableCreators(this));
|
||||
|
||||
QList<RunConfigurationCreationInfo> allAvailableFactories;
|
||||
QList<RunConfigurationCreationInfo> autoCreateFactories;
|
||||
for (IRunConfigurationFactory *rcFactory : rcFactories)
|
||||
autoCreateFactories.append(rcFactory->availableCreators(this,
|
||||
IRunConfigurationFactory::AutoCreate));
|
||||
|
||||
for (IRunConfigurationFactory *rcFactory : rcFactories) {
|
||||
if (rcFactory->canHandle(this)) {
|
||||
const QList<RunConfigurationCreationInfo> creators = rcFactory->availableCreators(this);
|
||||
for (const RunConfigurationCreationInfo &creator : creators) {
|
||||
allAvailableFactories.append(creator); // Manual and Auto
|
||||
if (creator.creationMode == RunConfigurationCreationInfo::AlwaysCreate)
|
||||
autoCreateFactories.append(creator); // Auto only.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Put outdated RCs into toRemove, do not bother with factories
|
||||
// that produce already existing RCs
|
||||
@@ -569,7 +574,7 @@ void Target::updateDefaultRunConfigurations()
|
||||
QList<RunConfigurationCreationInfo> existing;
|
||||
foreach (RunConfiguration *rc, existingConfigured) {
|
||||
bool present = false;
|
||||
for (const RunConfigurationCreationInfo &item : availableFactories) {
|
||||
for (const RunConfigurationCreationInfo &item : allAvailableFactories) {
|
||||
if (item.id == rc->id() && item.extra == rc->extraId()) {
|
||||
existing.append(item);
|
||||
present = true;
|
||||
|
@@ -271,10 +271,8 @@ public:
|
||||
addSupportedProjectType(PythonProjectId);
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo> availableCreators(Target *parent,
|
||||
CreationMode mode) const override
|
||||
QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const override
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->project()->files(Project::AllFiles),[this](const FileName &fn) {
|
||||
return convert(fn.toString(), fn.toString());
|
||||
});
|
||||
|
@@ -385,7 +385,7 @@ bool QbsRunConfigurationFactory::canCreateHelper(Target *parent, const QString &
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
QbsRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
QbsRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
QList<qbs::ProductData> products;
|
||||
|
||||
@@ -398,19 +398,23 @@ QbsRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode)
|
||||
products << product;
|
||||
}
|
||||
|
||||
if (mode == AutoCreate) {
|
||||
std::function<bool (const qbs::ProductData &)> hasQtcRunnable = [](const qbs::ProductData &product) {
|
||||
return product.properties().value("qtcRunnable").toBool();
|
||||
};
|
||||
const auto isQtcRunnable = [](const qbs::ProductData &product) {
|
||||
return product.properties().value("qtcRunnable").toBool();
|
||||
};
|
||||
const bool hasAnyQtcRunnable = Utils::anyOf(products, isQtcRunnable);
|
||||
|
||||
if (Utils::anyOf(products, hasQtcRunnable))
|
||||
Utils::erase(products, std::not1(hasQtcRunnable));
|
||||
}
|
||||
|
||||
return Utils::transform(products, [this, project](const qbs::ProductData &product) {
|
||||
return Utils::transform(products, [&](const qbs::ProductData &product) {
|
||||
const QString displayName = product.fullDisplayName();
|
||||
const QString targetName = QbsProject::uniqueProductName(product) + rcNameSeparator() + displayName;
|
||||
return convert(displayName, targetName);
|
||||
return RunConfigurationCreationInfo {
|
||||
this,
|
||||
runConfigurationBaseId(),
|
||||
targetName,
|
||||
displayName,
|
||||
(hasAnyQtcRunnable && !isQtcRunnable(product))
|
||||
? RunConfigurationCreationInfo::ManualCreationOnly
|
||||
: RunConfigurationCreationInfo::AlwaysCreate
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -119,7 +119,7 @@ public:
|
||||
bool canCreateHelper(ProjectExplorer::Target *parent, const QString &suffix) const override;
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -56,12 +56,10 @@ QmakeAndroidRunConfigurationFactory::QmakeAndroidRunConfigurationFactory(QObject
|
||||
setSupportedTargetDeviceTypes({Android::Constants::ANDROID_DEVICE_TYPE});
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo> QmakeAndroidRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFactory::CreationMode mode) const
|
||||
QList<RunConfigurationCreationInfo> QmakeAndroidRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
auto project = static_cast<QmakeProject *>(parent->project());
|
||||
return Utils::transform(project->buildTargets(mode, {ProjectType::ApplicationTemplate, ProjectType::SharedLibraryTemplate}),
|
||||
[this](const BuildTargetInfo &ti) { return convert(ti); });
|
||||
|
||||
return project->runConfigurationCreators(this, {ProjectType::ApplicationTemplate, ProjectType::SharedLibraryTemplate});
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
explicit QmakeAndroidRunConfigurationFactory(QObject *parent = nullptr);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const;
|
||||
availableCreators(ProjectExplorer::Target *parent) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -444,10 +444,10 @@ bool DesktopQmakeRunConfigurationFactory::canCreateHelper(Target *parent, const
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
DesktopQmakeRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
DesktopQmakeRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
||||
return Utils::transform(project->buildTargets(mode), [this](const BuildTargetInfo &ti) { return convert(ti); });
|
||||
return project->runConfigurationCreators(this);
|
||||
}
|
||||
|
||||
bool DesktopQmakeRunConfigurationFactory::hasRunConfigForProFile(RunConfiguration *rc, const Utils::FileName &n) const
|
||||
|
@@ -141,7 +141,7 @@ public:
|
||||
bool canCreateHelper(ProjectExplorer::Target *parent, const QString &suffix) const override;
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
|
||||
bool hasRunConfigForProFile(ProjectExplorer::RunConfiguration *rc, const Utils::FileName &n) const override;
|
||||
};
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include <projectexplorer/deploymentdata.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
@@ -784,26 +785,29 @@ bool QmakeProject::hasApplicationProFile(const FileName &path) const
|
||||
return Utils::contains(list, Utils::equal(&QmakeProFile::filePath, path));
|
||||
}
|
||||
|
||||
QList<BuildTargetInfo> QmakeProject::buildTargets(IRunConfigurationFactory::CreationMode mode,
|
||||
const QList<ProjectType> &projectTypes)
|
||||
QList<RunConfigurationCreationInfo>
|
||||
QmakeProject::runConfigurationCreators(const IRunConfigurationFactory *factory,
|
||||
const QList<ProjectType> &projectTypes)
|
||||
{
|
||||
QList<ProjectType> realTypes = projectTypes;
|
||||
if (realTypes.isEmpty())
|
||||
realTypes = {ProjectType::ApplicationTemplate, ProjectType::ScriptTemplate};
|
||||
QList<QmakeProFile *> files = allProFiles(realTypes);
|
||||
QList<QmakeProFile *> temp = files;
|
||||
|
||||
if (mode == IRunConfigurationFactory::AutoCreate) {
|
||||
QList<QmakeProFile *> filtered = Utils::filtered(files, [](const QmakeProFile *f) {
|
||||
return f->isQtcRunnable();
|
||||
});
|
||||
temp = filtered.isEmpty() ? files : filtered;
|
||||
}
|
||||
const QList<QmakeProFile *> files = allProFiles(realTypes);
|
||||
const auto isQtcRunnable = [](const QmakeProFile *f) { return f->isQtcRunnable(); };
|
||||
const bool hasAnyQtcRunnable = Utils::anyOf(files, isQtcRunnable);
|
||||
|
||||
return Utils::transform(temp, [](QmakeProFile *f) {
|
||||
BuildTargetInfo bti;
|
||||
bti.targetName = f->filePath().toString();
|
||||
return bti;
|
||||
return Utils::transform(files, [&](QmakeProFile *f) {
|
||||
const QString targetName = f->filePath().toString();
|
||||
return RunConfigurationCreationInfo {
|
||||
factory,
|
||||
factory->runConfigurationBaseId(),
|
||||
targetName,
|
||||
QFileInfo(targetName).completeBaseName(),
|
||||
(hasAnyQtcRunnable && !f->isQtcRunnable())
|
||||
? RunConfigurationCreationInfo::ManualCreationOnly
|
||||
: RunConfigurationCreationInfo::AlwaysCreate
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -73,9 +73,9 @@ public:
|
||||
QList<QmakeProFile *> applicationProFiles(Parsing parse = ExactParse) const;
|
||||
bool hasApplicationProFile(const Utils::FileName &path) const;
|
||||
|
||||
QList<ProjectExplorer::BuildTargetInfo>
|
||||
buildTargets(ProjectExplorer::IRunConfigurationFactory::CreationMode mode,
|
||||
const QList<ProjectType> &projectTypes = {});
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo> runConfigurationCreators
|
||||
(const ProjectExplorer::IRunConfigurationFactory *factory,
|
||||
const QList<ProjectType> &projectTypes = {});
|
||||
|
||||
static void notifyChanged(const Utils::FileName &name);
|
||||
|
||||
|
@@ -46,9 +46,8 @@ QnxRunConfigurationFactory::QnxRunConfigurationFactory(QObject *parent) :
|
||||
setSupportedTargetDeviceTypes({Constants::QNX_QNX_OS_TYPE});
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo> QnxRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFactory::CreationMode mode) const
|
||||
QList<RunConfigurationCreationInfo> QnxRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &bti) {
|
||||
return convert(tr("%1 on QNX Device").arg(QFileInfo(bti.targetName).completeBaseName()), bti.targetName);
|
||||
});
|
||||
|
@@ -27,8 +27,6 @@
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
namespace QmakeProjectManager { class QmakeProFileNode; }
|
||||
|
||||
namespace Qnx {
|
||||
namespace Internal {
|
||||
|
||||
@@ -39,7 +37,7 @@ public:
|
||||
explicit QnxRunConfigurationFactory(QObject *parent = nullptr);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -51,9 +51,8 @@ RemoteLinuxRunConfigurationFactory::RemoteLinuxRunConfigurationFactory(QObject *
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo>
|
||||
RemoteLinuxRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) const
|
||||
RemoteLinuxRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &bti) {
|
||||
return convert(tr("%1 (on Remote Generic Linux Host)").arg(bti.targetName),
|
||||
QFileInfo(bti.targetName).completeBaseName());
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
explicit RemoteLinuxRunConfigurationFactory(QObject *parent = nullptr);
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
};
|
||||
|
||||
class RemoteLinuxCustomRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
|
||||
|
@@ -50,12 +50,13 @@ WinRtRunConfigurationFactory::WinRtRunConfigurationFactory()
|
||||
Constants::WINRT_DEVICE_TYPE_EMULATOR});
|
||||
}
|
||||
|
||||
QList<RunConfigurationCreationInfo> WinRtRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFactory::CreationMode mode) const
|
||||
QList<RunConfigurationCreationInfo> WinRtRunConfigurationFactory::availableCreators(Target *parent) const
|
||||
{
|
||||
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
|
||||
const QList<BuildTargetInfo> buildTargets = project->buildTargets(mode);
|
||||
return Utils::transform(project->buildTargets(mode), [this](const BuildTargetInfo &bti) {
|
||||
return convert(tr("Run App Package"), bti.targetName);
|
||||
const QList<RunConfigurationCreationInfo> list = project->runConfigurationCreators(this);
|
||||
return Utils::transform(list, [this](RunConfigurationCreationInfo rci) {
|
||||
rci.displayName = tr("Run App Package");
|
||||
return rci;
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ public:
|
||||
WinRtRunConfigurationFactory();
|
||||
|
||||
QList<ProjectExplorer::RunConfigurationCreationInfo>
|
||||
availableCreators(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const override;
|
||||
availableCreators(ProjectExplorer::Target *parent) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user