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;
|
QList<Core::Id> ids;
|
||||||
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
|
||||||
return ids;
|
return ids;
|
||||||
|
if (!parent->project()->supportsProfile(parent->profile()))
|
||||||
|
return ids;
|
||||||
ProjectExplorer::ToolChain *tc
|
ProjectExplorer::ToolChain *tc
|
||||||
= ProjectExplorer::ToolChainProfileInformation::toolChain(parent->profile());
|
= ProjectExplorer::ToolChainProfileInformation::toolChain(parent->profile());
|
||||||
if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
|
if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
|
||||||
return ids;
|
return ids;
|
||||||
if (ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile())
|
const Core::Id devType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
|
||||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
|
if (devType == Core::Id(Constants::GenericLinuxOsType))
|
||||||
return ids;
|
|
||||||
|
|
||||||
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(parent->profile());
|
|
||||||
if (!dev.isNull() && dev->type() == Core::Id(Constants::GenericLinuxOsType))
|
|
||||||
ids << genericDeployConfigurationId();
|
ids << genericDeployConfigurationId();
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
@@ -447,6 +447,6 @@ void RemoteLinuxRunConfiguration::setDisabledReason(const QString &reason) const
|
|||||||
d->disabledReason = reason;
|
d->disabledReason = reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString RemoteLinuxRunConfiguration::Id = QLatin1String("RemoteLinuxRunConfiguration");
|
const QString RemoteLinuxRunConfiguration::IdPrefix = QLatin1String("RemoteLinuxRunConfiguration:");
|
||||||
|
|
||||||
} // namespace RemoteLinux
|
} // namespace RemoteLinux
|
||||||
|
@@ -111,7 +111,7 @@ public:
|
|||||||
|
|
||||||
QString proFilePath() const;
|
QString proFilePath() const;
|
||||||
|
|
||||||
static const QString Id;
|
static const QString IdPrefix;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void deploySpecsChanged();
|
void deploySpecsChanged();
|
||||||
|
@@ -57,9 +57,9 @@ namespace {
|
|||||||
QString pathFromId(Core::Id id)
|
QString pathFromId(Core::Id id)
|
||||||
{
|
{
|
||||||
QString idStr = QString::fromUtf8(id.name());
|
QString idStr = QString::fromUtf8(id.name());
|
||||||
if (!idStr.startsWith(RemoteLinuxRunConfiguration::Id))
|
if (!idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
||||||
return QString();
|
return QString();
|
||||||
return idStr.mid(RemoteLinuxRunConfiguration::Id.size());
|
return idStr.mid(RemoteLinuxRunConfiguration::IdPrefix.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -83,7 +83,7 @@ bool RemoteLinuxRunConfigurationFactory::canRestore(Target *parent, const QVaria
|
|||||||
{
|
{
|
||||||
if (!canHandle(parent))
|
if (!canHandle(parent))
|
||||||
return false;
|
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
|
bool RemoteLinuxRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
|
||||||
@@ -101,7 +101,7 @@ QList<Core::Id> RemoteLinuxRunConfigurationFactory::availableCreationIds(Target
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
QStringList proFiles = static_cast<Qt4Project *>(parent->project())
|
QStringList proFiles = static_cast<Qt4Project *>(parent->project())
|
||||||
->applicationProFilePathes(RemoteLinuxRunConfiguration::Id);
|
->applicationProFilePathes(RemoteLinuxRunConfiguration::IdPrefix);
|
||||||
foreach (const QString &pf, proFiles)
|
foreach (const QString &pf, proFiles)
|
||||||
result << Core::Id(pf);
|
result << Core::Id(pf);
|
||||||
return result;
|
return result;
|
||||||
@@ -124,7 +124,7 @@ RunConfiguration *RemoteLinuxRunConfigurationFactory::restore(Target *parent,
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(canRestore(parent, map), return 0);
|
QTC_ASSERT(canRestore(parent, map), return 0);
|
||||||
RemoteLinuxRunConfiguration *rc
|
RemoteLinuxRunConfiguration *rc
|
||||||
= new RemoteLinuxRunConfiguration(parent, Core::Id(RemoteLinuxRunConfiguration::Id), QString());
|
= new RemoteLinuxRunConfiguration(parent, Core::Id(RemoteLinuxRunConfiguration::IdPrefix), QString());
|
||||||
if (rc->fromMap(map))
|
if (rc->fromMap(map))
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QString idStr = QString::fromLatin1(runConfiguration->id().name());
|
const QString idStr = QString::fromLatin1(runConfiguration->id().name());
|
||||||
if (!runConfiguration->isEnabled() || !idStr.startsWith(RemoteLinuxRunConfiguration::Id))
|
if (!runConfiguration->isEnabled() || !idStr.startsWith(RemoteLinuxRunConfiguration::IdPrefix))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mode == NormalRunMode)
|
if (mode == NormalRunMode)
|
||||||
|
Reference in New Issue
Block a user