forked from qt-creator/qt-creator
ProjectExplorer: Remove BuildTargetInfo::displayName
This was previously intented to be used in the RunConfig Add... menu, but this role is now taken by RunConfigurationCreationInfo::displayName. This fixes also a regression for setups that relied on QmakeProject::buildTargets() and a fix up empty display names later. Change-Id: If75fc79efbdedc918a126e50c962fc188d7a3ebc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
QString targetName;
|
||||
|
||||
QString displayName; // Used in "RunConfiguration Add ..." drop down.
|
||||
Utils::FileName targetFilePath;
|
||||
Utils::FileName projectFilePath;
|
||||
|
||||
|
@@ -453,7 +453,8 @@ IRunConfigurationFactory::availableCreators(Target *parent, IRunConfigurationFac
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &ti) {
|
||||
return RunConfigurationCreationInfo(this, m_runConfigBaseId, ti.targetName, ti.displayName);
|
||||
return RunConfigurationCreationInfo(this, m_runConfigBaseId, ti.targetName,
|
||||
QFileInfo(ti.targetName).completeBaseName());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -476,7 +477,7 @@ void IRunConfigurationFactory::addSupportedProjectType(Core::Id id)
|
||||
RunConfigurationCreationInfo
|
||||
IRunConfigurationFactory::convert(const BuildTargetInfo &ti) const
|
||||
{
|
||||
return convert(ti.displayName, ti.targetName);
|
||||
return convert(QFileInfo(ti.targetName).completeBaseName(), ti.targetName);
|
||||
}
|
||||
|
||||
RunConfigurationCreationInfo
|
||||
|
@@ -803,7 +803,6 @@ QList<BuildTargetInfo> QmakeProject::buildTargets(IRunConfigurationFactory::Crea
|
||||
return Utils::transform(temp, [](QmakeProFile *f) {
|
||||
BuildTargetInfo bti;
|
||||
bti.targetName = f->filePath().toString();
|
||||
bti.displayName = QFileInfo(bti.targetName).completeBaseName();
|
||||
return bti;
|
||||
});
|
||||
}
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace RemoteLinux {
|
||||
@@ -58,8 +60,9 @@ QList<RunConfigurationCreationInfo>
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
return Utils::transform(parent->applicationTargets().list, [this](const BuildTargetInfo &bti) {
|
||||
return convert(tr("%1 (on Remote Generic Linux Host)").arg(bti.displayName), bti.targetName);
|
||||
});
|
||||
return convert(tr("%1 (on Remote Generic Linux Host)").arg(bti.targetName),
|
||||
QFileInfo(bti.targetName).completeBaseName());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user