Commit 07cab1ab authored by hjk's avatar hjk

RemoteLinux: Avoid some use of Core::Id QString use

Change-Id: Id5e45466f85f61dfbe3e6d98646cc25dcc72d7e6
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 11cd0e5b
......@@ -380,6 +380,6 @@ void RemoteLinuxRunConfiguration::setDisabledReason(const QString &reason) const
d->disabledReason = reason;
}
const QString RemoteLinuxRunConfiguration::IdPrefix = QLatin1String("RemoteLinuxRunConfiguration:");
const char *RemoteLinuxRunConfiguration::IdPrefix = "RemoteLinuxRunConfiguration:";
} // namespace RemoteLinux
......@@ -98,7 +98,7 @@ public:
QString projectFilePath() const;
static const QString IdPrefix;
static const char *IdPrefix;
signals:
void deploySpecsChanged();
......
......@@ -49,10 +49,10 @@ namespace Internal {
namespace {
QString pathFromId(Core::Id id)
{
QString idStr = QString::fromUtf8(id.name());
QByteArray idStr = id.name();
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
return QString();
return idStr.mid(RemoteLinuxRunConfiguration::IdPrefix.size());
return QString::fromUtf8(idStr.mid(strlen(RemoteLinuxRunConfiguration::IdPrefix)));
}
} // namespace
......@@ -78,7 +78,7 @@ bool RemoteLinuxRunConfigurationFactory::canRestore(Target *parent, const QVaria
{
if (!canHandle(parent))
return false;
return idFromMap(map).toString().startsWith(RemoteLinuxRunConfiguration::IdPrefix);
return idFromMap(map).name().startsWith(RemoteLinuxRunConfiguration::IdPrefix);
}
bool RemoteLinuxRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
......@@ -94,8 +94,9 @@ QList<Core::Id> RemoteLinuxRunConfigurationFactory::availableCreationIds(Target
if (!canHandle(parent))
return result;
const Core::Id base = Core::Id(RemoteLinuxRunConfiguration::IdPrefix);
foreach (const BuildTargetInfo &bti, parent->applicationTargets().list)
result << (Core::Id(RemoteLinuxRunConfiguration::IdPrefix + bti.projectFilePath.toString()));
result << base.withSuffix(bti.projectFilePath.toString());
return result;
}
......
......@@ -62,7 +62,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
if (mode != NormalRunMode && mode != DebugRunMode && mode != DebugRunModeWithBreakOnMain)
return false;
const QString idStr = QString::fromLatin1(runConfiguration->id().name());
const QByteArray idStr = runConfiguration->id().name();
if (!runConfiguration->isEnabled() || !idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
return false;
......
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