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)
|
||||
{
|
||||
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
|
||||
|
Reference in New Issue
Block a user