forked from qt-creator/qt-creator
Make clear that the RemoteLinuxRC Id is actually a prefix
Change-Id: Ie877c563fd80d96db0527dfcfbdfbff6762409cf Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -63,16 +63,14 @@ QList<Core::Id> RemoteLinuxDeployConfigurationFactory::availableCreationIds(Targ
|
||||
QList<Core::Id> ids;
|
||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||
return ids;
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
return ids;
|
||||
ProjectExplorer::ToolChain *tc
|
||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(parent->profile());
|
||||
if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
|
||||
return ids;
|
||||
if (ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile())
|
||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
|
||||
return ids;
|
||||
|
||||
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(parent->profile());
|
||||
if (!dev.isNull() && dev->type() == Core::Id(Constants::GenericLinuxOsType))
|
||||
const Core::Id devType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
|
||||
if (devType == Core::Id(Constants::GenericLinuxOsType))
|
||||
ids << genericDeployConfigurationId();
|
||||
return ids;
|
||||
}
|
||||
|
@@ -447,6 +447,6 @@ void RemoteLinuxRunConfiguration::setDisabledReason(const QString &reason) const
|
||||
d->disabledReason = reason;
|
||||
}
|
||||
|
||||
const QString RemoteLinuxRunConfiguration::Id = QLatin1String("RemoteLinuxRunConfiguration");
|
||||
const QString RemoteLinuxRunConfiguration::IdPrefix = QLatin1String("RemoteLinuxRunConfiguration:");
|
||||
|
||||
} // namespace RemoteLinux
|
||||
|
@@ -111,7 +111,7 @@ public:
|
||||
|
||||
QString proFilePath() const;
|
||||
|
||||
static const QString Id;
|
||||
static const QString IdPrefix;
|
||||
|
||||
signals:
|
||||
void deploySpecsChanged();
|
||||
|
@@ -57,9 +57,9 @@ namespace {
|
||||
QString pathFromId(Core::Id id)
|
||||
{
|
||||
QString idStr = QString::fromUtf8(id.name());
|
||||
if (!idStr.startsWith(RemoteLinuxRunConfiguration::Id))
|
||||
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
||||
return QString();
|
||||
return idStr.mid(RemoteLinuxRunConfiguration::Id.size());
|
||||
return idStr.mid(RemoteLinuxRunConfiguration::IdPrefix.size());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -83,7 +83,7 @@ bool RemoteLinuxRunConfigurationFactory::canRestore(Target *parent, const QVaria
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return false;
|
||||
return ProjectExplorer::idFromMap(map).toString().startsWith(RemoteLinuxRunConfiguration::Id);
|
||||
return ProjectExplorer::idFromMap(map).toString().startsWith(RemoteLinuxRunConfiguration::IdPrefix);
|
||||
}
|
||||
|
||||
bool RemoteLinuxRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
|
||||
@@ -101,7 +101,7 @@ QList<Core::Id> RemoteLinuxRunConfigurationFactory::availableCreationIds(Target
|
||||
return result;
|
||||
|
||||
QStringList proFiles = static_cast<Qt4Project *>(parent->project())
|
||||
->applicationProFilePathes(RemoteLinuxRunConfiguration::Id);
|
||||
->applicationProFilePathes(RemoteLinuxRunConfiguration::IdPrefix);
|
||||
foreach (const QString &pf, proFiles)
|
||||
result << Core::Id(pf);
|
||||
return result;
|
||||
@@ -124,7 +124,7 @@ RunConfiguration *RemoteLinuxRunConfigurationFactory::restore(Target *parent,
|
||||
{
|
||||
QTC_ASSERT(canRestore(parent, map), return 0);
|
||||
RemoteLinuxRunConfiguration *rc
|
||||
= new RemoteLinuxRunConfiguration(parent, Core::Id(RemoteLinuxRunConfiguration::Id), QString());
|
||||
= new RemoteLinuxRunConfiguration(parent, Core::Id(RemoteLinuxRunConfiguration::IdPrefix), QString());
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
|
||||
return false;
|
||||
|
||||
const QString idStr = QString::fromLatin1(runConfiguration->id().name());
|
||||
if (!runConfiguration->isEnabled() || !idStr.startsWith(RemoteLinuxRunConfiguration::Id))
|
||||
if (!runConfiguration->isEnabled() || !idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
||||
return false;
|
||||
|
||||
if (mode == NormalRunMode)
|
||||
|
Reference in New Issue
Block a user