forked from qt-creator/qt-creator
BareMetal: Fix target file name resolving
Broke by 1acd9d30dc
.
Change-Id: I0dbf14aeb345743eb22a033ac3570c6af4eb0bb2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
846d89811a
commit
ec4269f6a1
@@ -124,17 +124,15 @@ QString BareMetalRunConfiguration::defaultDisplayName()
|
||||
{
|
||||
if (!m_projectFilePath.isEmpty())
|
||||
//: %1 is the name of the project run via hardware debugger
|
||||
return tr("%1 (via GDB server or hardware debugger)").arg(QFileInfo(m_projectFilePath).completeBaseName());
|
||||
return tr("%1 (via GDB server or hardware debugger)").arg(QFileInfo(m_projectFilePath).fileName());
|
||||
//: Bare Metal run configuration default run name
|
||||
return tr("Run on GDB server or hardware debugger");
|
||||
}
|
||||
|
||||
QString BareMetalRunConfiguration::localExecutableFilePath() const
|
||||
{
|
||||
const QString targetName = QFileInfo(m_projectFilePath).completeBaseName();
|
||||
|
||||
return target()->applicationTargets()
|
||||
.targetFilePath(FileName::fromString(targetName).toString()).toString();
|
||||
const QString targetName = QFileInfo(m_projectFilePath).fileName();
|
||||
return target()->applicationTargets().targetFilePath(targetName).toString();
|
||||
}
|
||||
|
||||
QString BareMetalRunConfiguration::arguments() const
|
||||
@@ -161,7 +159,7 @@ QString BareMetalRunConfiguration::buildSystemTarget() const
|
||||
{
|
||||
const BuildTargetInfoList targets = target()->applicationTargets();
|
||||
const Utils::FileName projectFilePath = Utils::FileName::fromString(QFileInfo(m_projectFilePath).path());
|
||||
const QString targetName = QFileInfo(m_projectFilePath).completeBaseName();
|
||||
const QString targetName = QFileInfo(m_projectFilePath).fileName();
|
||||
auto bst = std::find_if(targets.list.constBegin(), targets.list.constEnd(),
|
||||
[&projectFilePath,&targetName](const BuildTargetInfo &bti) { return bti.projectFilePath == projectFilePath && bti.targetName == targetName; });
|
||||
return (bst == targets.list.constEnd()) ? QString() : bst->targetName;
|
||||
|
@@ -60,7 +60,7 @@ bool BareMetalRunConfigurationFactory::canCreate(Target *parent, Core::Id id) co
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return false;
|
||||
const QString targetName = QFileInfo(pathFromId(id)).completeBaseName();
|
||||
const QString targetName = QFileInfo(pathFromId(id)).fileName();
|
||||
return id == BareMetalCustomRunConfiguration::runConfigId()
|
||||
|| !parent->applicationTargets().targetFilePath(targetName).isEmpty();
|
||||
}
|
||||
@@ -100,7 +100,7 @@ QString BareMetalRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
if (id == BareMetalCustomRunConfiguration::runConfigId())
|
||||
return BareMetalCustomRunConfiguration::runConfigDefaultDisplayName();
|
||||
return tr("%1 (on GDB server or hardware debugger)")
|
||||
.arg(QFileInfo(pathFromId(id)).completeBaseName());
|
||||
.arg(QFileInfo(pathFromId(id)).fileName());
|
||||
}
|
||||
|
||||
RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||
|
Reference in New Issue
Block a user