Commit ec4269f6 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

BareMetal: Fix target file name resolving

Broke by 1acd9d30.

Change-Id: I0dbf14aeb345743eb22a033ac3570c6af4eb0bb2
Reviewed-by: default avatarhjk <hjk@qt.io>
Reviewed-by: default avatarDenis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
Reviewed-by: default avatarAlexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 846d8981
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment