forked from qt-creator/qt-creator
Add some pass-through fields for {RunConfiguration,BuildTarget}Info
This is unused here by will be used in subsequent changes. Project parsing yields information on whether there's a console requested and whether the "magic" qtc_runnable flag for primary executables has been seen. Also, the current "targetname" is taking different roles in different context, try to split-off the pure visual aspect by allowing to specify an explicit displayName, with fallback to the current decorated targetName if empty. Task-number: QTCREATORBUG-19985 Change-Id: I11edfcaafd17972f6a78aeff3fbbf3d7eb91a213 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -47,10 +47,14 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
QString targetName;
|
QString targetName;
|
||||||
|
QString displayName;
|
||||||
|
|
||||||
Utils::FileName targetFilePath;
|
Utils::FileName targetFilePath;
|
||||||
Utils::FileName projectFilePath;
|
Utils::FileName projectFilePath;
|
||||||
|
|
||||||
|
bool isAutoRunnable = true;
|
||||||
|
bool usesTerminal = false;
|
||||||
|
|
||||||
bool isValid() const { return !targetName.isEmpty(); }
|
bool isValid() const { return !targetName.isEmpty(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -471,8 +471,13 @@ QList<RunConfigurationCreationInfo>
|
|||||||
RunConfigurationFactory::availableCreators(Target *parent) const
|
RunConfigurationFactory::availableCreators(Target *parent) const
|
||||||
{
|
{
|
||||||
return Utils::transform(parent->applicationTargets().list, [parent, this](const BuildTargetInfo &ti) {
|
return Utils::transform(parent->applicationTargets().list, [parent, this](const BuildTargetInfo &ti) {
|
||||||
const QString displayName = decoratedTargetName(ti.targetName, parent);
|
QString displayName = ti.displayName;
|
||||||
return RunConfigurationCreationInfo(this, m_runConfigBaseId, ti.targetName, displayName);
|
if (displayName.isEmpty())
|
||||||
|
displayName = decoratedTargetName(ti.targetName, parent);
|
||||||
|
return RunConfigurationCreationInfo(this, m_runConfigBaseId, ti.targetName, displayName,
|
||||||
|
ti.isAutoRunnable ? RunConfigurationCreationInfo::AlwaysCreate
|
||||||
|
: RunConfigurationCreationInfo::ManualCreationOnly,
|
||||||
|
ti.usesTerminal);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -283,14 +283,17 @@ class RunConfigurationCreationInfo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum CreationMode {AlwaysCreate, ManualCreationOnly};
|
enum CreationMode {AlwaysCreate, ManualCreationOnly};
|
||||||
|
RunConfigurationCreationInfo() = default;
|
||||||
RunConfigurationCreationInfo(const RunConfigurationFactory *factory,
|
RunConfigurationCreationInfo(const RunConfigurationFactory *factory,
|
||||||
Core::Id id,
|
Core::Id id,
|
||||||
QString extra, QString displayName,
|
QString extra, QString displayName,
|
||||||
CreationMode creationMode = AlwaysCreate)
|
CreationMode creationMode = AlwaysCreate,
|
||||||
|
bool useTerminal = false)
|
||||||
: factory(factory), id(id),
|
: factory(factory), id(id),
|
||||||
extra(extra),
|
extra(extra),
|
||||||
displayName(displayName),
|
displayName(displayName),
|
||||||
creationMode(creationMode)
|
creationMode(creationMode),
|
||||||
|
useTerminal(useTerminal)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const RunConfigurationFactory *factory = nullptr;
|
const RunConfigurationFactory *factory = nullptr;
|
||||||
@@ -298,6 +301,7 @@ public:
|
|||||||
QString extra;
|
QString extra;
|
||||||
QString displayName;
|
QString displayName;
|
||||||
CreationMode creationMode = AlwaysCreate;
|
CreationMode creationMode = AlwaysCreate;
|
||||||
|
bool useTerminal = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT RunConfigurationFactory : public QObject
|
class PROJECTEXPLORER_EXPORT RunConfigurationFactory : public QObject
|
||||||
|
|||||||
Reference in New Issue
Block a user