forked from qt-creator/qt-creator
RunFactories: Simplify pathFromId by using Core::Id::suffixAfter
Change-Id: I2b65071be3e57c59588e6421d15c7739c257e1c5 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -59,11 +59,7 @@ namespace Internal {
|
|||||||
|
|
||||||
static QString pathFromId(const Core::Id id)
|
static QString pathFromId(const Core::Id id)
|
||||||
{
|
{
|
||||||
QString pathStr = id.toString();
|
return id.suffixAfter(IOS_RC_ID_PREFIX);
|
||||||
const QString prefix = QLatin1String(IOS_RC_ID_PREFIX);
|
|
||||||
if (!pathStr.startsWith(prefix))
|
|
||||||
return QString();
|
|
||||||
return pathStr.mid(prefix.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
|
IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
|
||||||
|
@@ -49,10 +49,7 @@ namespace Internal {
|
|||||||
namespace {
|
namespace {
|
||||||
QString pathFromId(Core::Id id)
|
QString pathFromId(Core::Id id)
|
||||||
{
|
{
|
||||||
QByteArray idStr = id.name();
|
return id.suffixAfter(RemoteLinuxRunConfiguration::IdPrefix);
|
||||||
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
|
||||||
return QString();
|
|
||||||
return QString::fromUtf8(idStr.mid(strlen(RemoteLinuxRunConfiguration::IdPrefix)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Reference in New Issue
Block a user