Commit d15e0aa9 authored by Daniel Teske's avatar Daniel Teske

RunFactories: Simplify pathFromId by using Core::Id::suffixAfter

Change-Id: I2b65071be3e57c59588e6421d15c7739c257e1c5
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent ca920be2
......@@ -59,11 +59,7 @@ namespace Internal {
static QString pathFromId(const Core::Id id)
{
QString pathStr = id.toString();
const QString prefix = QLatin1String(IOS_RC_ID_PREFIX);
if (!pathStr.startsWith(prefix))
return QString();
return pathStr.mid(prefix.size());
return id.suffixAfter(IOS_RC_ID_PREFIX);
}
IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
......
......@@ -49,10 +49,7 @@ namespace Internal {
namespace {
QString pathFromId(Core::Id id)
{
QByteArray idStr = id.name();
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
return QString();
return QString::fromUtf8(idStr.mid(strlen(RemoteLinuxRunConfiguration::IdPrefix)));
return id.suffixAfter(RemoteLinuxRunConfiguration::IdPrefix);
}
} // namespace
......
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