forked from qt-creator/qt-creator
Device support: Use Core::Id for device type.
Change-Id: Ic51f6239a34ad752064d7ee6b6f48a9851311135 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -53,7 +53,7 @@ MaddeDevice::Ptr MaddeDevice::create()
|
||||
return Ptr(new MaddeDevice);
|
||||
}
|
||||
|
||||
MaddeDevice::Ptr MaddeDevice::create(const QString &name, const QString &type,
|
||||
MaddeDevice::Ptr MaddeDevice::create(const QString &name, Core::Id type,
|
||||
MachineType machineType, Origin origin, Core::Id id)
|
||||
{
|
||||
return Ptr(new MaddeDevice(name, type, machineType, origin, id));
|
||||
@@ -63,7 +63,7 @@ MaddeDevice::MaddeDevice()
|
||||
{
|
||||
}
|
||||
|
||||
MaddeDevice::MaddeDevice(const QString &name, const QString &type, MachineType machineType,
|
||||
MaddeDevice::MaddeDevice(const QString &name, Core::Id type, MachineType machineType,
|
||||
Origin origin, Core::Id id)
|
||||
: LinuxDeviceConfiguration(name, type, machineType, origin, id)
|
||||
{
|
||||
@@ -120,11 +120,11 @@ void MaddeDevice::executeAction(Core::Id actionId, QWidget *parent) const
|
||||
d->exec();
|
||||
}
|
||||
|
||||
QString MaddeDevice::maddeDisplayType(const QString &type)
|
||||
QString MaddeDevice::maddeDisplayType(Core::Id type)
|
||||
{
|
||||
if (type == QLatin1String(Maemo5OsType))
|
||||
if (type == Core::Id(Maemo5OsType))
|
||||
return tr("Maemo5/Fremantle");
|
||||
if (type == QLatin1String(HarmattanOsType))
|
||||
if (type == Core::Id(HarmattanOsType))
|
||||
return tr("MeeGo 1.2 Harmattan");
|
||||
return tr("Other MeeGo OS");
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
typedef QSharedPointer<const MaddeDevice> ConstPtr;
|
||||
|
||||
static Ptr create();
|
||||
static Ptr create(const QString &name, const QString &type, MachineType machineType,
|
||||
static Ptr create(const QString &name, Core::Id type, MachineType machineType,
|
||||
Origin origin = ManuallyAdded, Core::Id id = Core::Id());
|
||||
|
||||
QString displayType() const;
|
||||
@@ -55,11 +55,11 @@ public:
|
||||
QString displayNameForActionId(Core::Id actionId) const;
|
||||
void executeAction(Core::Id actionId, QWidget *parent) const;
|
||||
ProjectExplorer::IDevice::Ptr clone() const;
|
||||
static QString maddeDisplayType(const QString &type);
|
||||
static QString maddeDisplayType(Core::Id type);
|
||||
|
||||
private:
|
||||
MaddeDevice();
|
||||
MaddeDevice(const QString &name, const QString &type, MachineType machineType,
|
||||
MaddeDevice(const QString &name, Core::Id type, MachineType machineType,
|
||||
Origin origin, Core::Id id);
|
||||
|
||||
MaddeDevice(const MaddeDevice &other);
|
||||
|
||||
@@ -68,9 +68,9 @@ IDevice::Ptr MaddeDeviceConfigurationFactory::create() const
|
||||
|
||||
bool MaddeDeviceConfigurationFactory::canRestore(const QVariantMap &map) const
|
||||
{
|
||||
const QString type = IDevice::typeFromMap(map);
|
||||
return type == QLatin1String(Maemo5OsType) || type == QLatin1String(HarmattanOsType)
|
||||
|| type == QLatin1String(MeeGoOsType);
|
||||
const Core::Id type = IDevice::typeFromMap(map);
|
||||
return type == Core::Id(Maemo5OsType) || type == Core::Id(HarmattanOsType)
|
||||
|| type == Core::Id(MeeGoOsType);
|
||||
}
|
||||
|
||||
IDevice::Ptr MaddeDeviceConfigurationFactory::restore(const QVariantMap &map) const
|
||||
|
||||
@@ -117,7 +117,7 @@ void MaddeDeviceTester::handleGenericTestFinished(TestResult result)
|
||||
connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int)));
|
||||
|
||||
QString qtInfoCmd;
|
||||
if (m_deviceConfiguration->type() == QLatin1String(MeeGoOsType)) {
|
||||
if (m_deviceConfiguration->type() == Core::Id(MeeGoOsType)) {
|
||||
qtInfoCmd = QLatin1String("rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}\\n'");
|
||||
} else {
|
||||
qtInfoCmd = QLatin1String("dpkg-query -W -f "
|
||||
@@ -212,7 +212,7 @@ void MaddeDeviceTester::handleMadDeveloperTestFinished(int exitStatus)
|
||||
} else if (m_processRunner->processExitCode() != 0) {
|
||||
QString message = tr("Connectivity tool not installed on device. "
|
||||
"Deployment currently not possible.");
|
||||
if (m_deviceConfiguration->type() == QLatin1String(HarmattanOsType)) {
|
||||
if (m_deviceConfiguration->type() == Core::Id(HarmattanOsType)) {
|
||||
message += tr("Please switch the device to developer mode "
|
||||
"via Settings -> Security.");
|
||||
}
|
||||
@@ -222,7 +222,7 @@ void MaddeDeviceTester::handleMadDeveloperTestFinished(int exitStatus)
|
||||
emit progressMessage(tr("Connectivity tool present.\n"));
|
||||
}
|
||||
|
||||
if (m_deviceConfiguration->type() != QLatin1String(HarmattanOsType)) {
|
||||
if (m_deviceConfiguration->type() != Core::Id(HarmattanOsType)) {
|
||||
setFinished();
|
||||
return;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ QString MaddeDeviceTester::processedQtLibsList()
|
||||
QString unfilteredLibs = QString::fromUtf8(m_stdout);
|
||||
QString filteredLibs;
|
||||
QString patternString;
|
||||
if (m_deviceConfiguration->type() == QLatin1String(MeeGoOsType))
|
||||
if (m_deviceConfiguration->type() == Core::Id(MeeGoOsType))
|
||||
patternString = QLatin1String("(libqt\\S+) ((\\d+)\\.(\\d+)\\.(\\d+))");
|
||||
else
|
||||
patternString = QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+");
|
||||
|
||||
@@ -62,9 +62,9 @@ namespace Madde {
|
||||
namespace Internal {
|
||||
namespace {
|
||||
|
||||
QString defaultUser(const QString &deviceType)
|
||||
QString defaultUser(Core::Id deviceType)
|
||||
{
|
||||
if (deviceType == QLatin1String(MeeGoOsType))
|
||||
if (deviceType == Core::Id(MeeGoOsType))
|
||||
return QLatin1String("meego");
|
||||
return QLatin1String("developer");
|
||||
}
|
||||
@@ -78,7 +78,7 @@ struct WizardData
|
||||
{
|
||||
QString configName;
|
||||
QString hostName;
|
||||
QString deviceType;
|
||||
Core::Id deviceType;
|
||||
SshConnectionParameters::AuthenticationType authType;
|
||||
LinuxDeviceConfiguration::MachineType machineType;
|
||||
QString privateKeyFilePath;
|
||||
@@ -105,12 +105,13 @@ public:
|
||||
setTitle(tr("General Information"));
|
||||
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
|
||||
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(QLatin1String(Maemo5OsType)),
|
||||
QLatin1String(Maemo5OsType));
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(QLatin1String(HarmattanOsType)),
|
||||
QLatin1String(HarmattanOsType));
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(QLatin1String(MeeGoOsType)),
|
||||
QLatin1String(MeeGoOsType));
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(Core::Id(Maemo5OsType)),
|
||||
QVariant::fromValue(Core::Id(Maemo5OsType)));
|
||||
const QVariant harmattanIdVariant = QVariant::fromValue(Core::Id(HarmattanOsType));
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(Core::Id(HarmattanOsType)),
|
||||
harmattanIdVariant);
|
||||
m_ui->osTypeComboBox->addItem(MaddeDevice::maddeDisplayType(Core::Id(MeeGoOsType)),
|
||||
QVariant::fromValue(Core::Id(MeeGoOsType)));
|
||||
|
||||
QButtonGroup *buttonGroup = new QButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
@@ -119,7 +120,7 @@ public:
|
||||
connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(handleMachineTypeChanged()));
|
||||
|
||||
m_ui->nameLineEdit->setText(tr("MeeGo Device"));
|
||||
m_ui->osTypeComboBox->setCurrentIndex(m_ui->osTypeComboBox->findData(QLatin1String(HarmattanOsType)));
|
||||
m_ui->osTypeComboBox->setCurrentIndex(m_ui->osTypeComboBox->findData(harmattanIdVariant));
|
||||
m_ui->hwButton->setChecked(true);
|
||||
handleMachineTypeChanged();
|
||||
m_ui->hostNameLineEdit->setText(defaultHost(machineType()));
|
||||
@@ -146,9 +147,9 @@ public:
|
||||
: m_ui->hostNameLineEdit->text().trimmed();
|
||||
}
|
||||
|
||||
QString deviceType() const
|
||||
Core::Id deviceType() const
|
||||
{
|
||||
return m_ui->osTypeComboBox->itemData(m_ui->osTypeComboBox->currentIndex()).toString();
|
||||
return m_ui->osTypeComboBox->itemData(m_ui->osTypeComboBox->currentIndex()).value<Core::Id>();
|
||||
}
|
||||
|
||||
LinuxDeviceConfiguration::MachineType machineType() const
|
||||
@@ -566,7 +567,7 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
|
||||
sshParams.port = d->wizardData.sshPort;
|
||||
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator) {
|
||||
sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
|
||||
sshParams.password = d->wizardData.deviceType == QLatin1String(MeeGoOsType)
|
||||
sshParams.password = d->wizardData.deviceType == Core::Id(MeeGoOsType)
|
||||
? QLatin1String("meego") : QString();
|
||||
sshParams.timeout = 30;
|
||||
freePortsSpec = QLatin1String("13219,14168");
|
||||
|
||||
@@ -80,20 +80,20 @@ bool MaemoGlobal::isMeegoTargetId(const Core::Id id)
|
||||
|
||||
bool MaemoGlobal::isValidMaemo5QtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(qmakePath, QLatin1String(Maemo5OsType));
|
||||
return isValidMaemoQtVersion(qmakePath, Core::Id(Maemo5OsType));
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidHarmattanQtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(qmakePath, QLatin1String(HarmattanOsType));
|
||||
return isValidMaemoQtVersion(qmakePath, Core::Id(HarmattanOsType));
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidMeegoQtVersion(const QString &qmakePath)
|
||||
{
|
||||
return isValidMaemoQtVersion(qmakePath, QLatin1String(MeeGoOsType));
|
||||
return isValidMaemoQtVersion(qmakePath, Core::Id(MeeGoOsType));
|
||||
}
|
||||
|
||||
bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath, const QString &deviceType)
|
||||
bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath, Core::Id deviceType)
|
||||
{
|
||||
if (MaemoGlobal::deviceType(qmakePath) != deviceType)
|
||||
return false;
|
||||
@@ -133,12 +133,12 @@ int MaemoGlobal::applicationIconSize(const ProjectExplorer::Target *target)
|
||||
return qobject_cast<const Qt4HarmattanTarget *>(target) ? 80 : 64;
|
||||
}
|
||||
|
||||
QString MaemoGlobal::remoteSudo(const QString &deviceType, const QString &uname)
|
||||
QString MaemoGlobal::remoteSudo(Core::Id deviceType, const QString &uname)
|
||||
{
|
||||
if (uname == QLatin1String("root"))
|
||||
return QString();
|
||||
if (deviceType == QLatin1String(Maemo5OsType) || deviceType == QLatin1String(HarmattanOsType)
|
||||
|| deviceType == QLatin1String(MeeGoOsType)) {
|
||||
if (deviceType == Core::Id(Maemo5OsType) || deviceType == Core::Id(HarmattanOsType)
|
||||
|| deviceType == Core::Id(MeeGoOsType)) {
|
||||
return devrootshPath();
|
||||
}
|
||||
return QString(); // Using sudo would open a can of worms.
|
||||
@@ -200,22 +200,22 @@ QString MaemoGlobal::madCommand(const QString &qmakePath)
|
||||
return maddeRoot(qmakePath) + QLatin1String("/bin/mad");
|
||||
}
|
||||
|
||||
QString MaemoGlobal::madDeveloperUiName(const QString &deviceType)
|
||||
QString MaemoGlobal::madDeveloperUiName(Core::Id deviceType)
|
||||
{
|
||||
return deviceType == QLatin1String(HarmattanOsType)
|
||||
return deviceType == Core::Id(HarmattanOsType)
|
||||
? tr("SDK Connectivity") : tr("Mad Developer");
|
||||
}
|
||||
|
||||
QString MaemoGlobal::deviceType(const QString &qmakePath)
|
||||
Core::Id MaemoGlobal::deviceType(const QString &qmakePath)
|
||||
{
|
||||
const QString &name = targetName(qmakePath);
|
||||
if (name.startsWith(QLatin1String("fremantle")))
|
||||
return QLatin1String(Maemo5OsType);
|
||||
return Core::Id(Maemo5OsType);
|
||||
if (name.startsWith(QLatin1String("harmattan")))
|
||||
return QLatin1String(HarmattanOsType);
|
||||
return Core::Id(HarmattanOsType);
|
||||
if (name.startsWith(QLatin1String("meego")))
|
||||
return QLatin1String(MeeGoOsType);
|
||||
return QLatin1String(RemoteLinux::Constants::GenericLinuxOsType);
|
||||
return Core::Id(MeeGoOsType);
|
||||
return Core::Id(RemoteLinux::Constants::GenericLinuxOsType);
|
||||
}
|
||||
|
||||
QString MaemoGlobal::architecture(const QString &qmakePath)
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
static QString homeDirOnDevice(const QString &uname);
|
||||
static QString devrootshPath();
|
||||
static int applicationIconSize(const ProjectExplorer::Target *target);
|
||||
static QString remoteSudo(const QString &deviceType, const QString &uname);
|
||||
static QString remoteSudo(Core::Id deviceType, const QString &uname);
|
||||
static QString remoteSourceProfilesCommand();
|
||||
static Utils::PortList freePorts(const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
|
||||
const QtSupport::BaseQtVersion *qtVersion);
|
||||
@@ -106,8 +106,8 @@ public:
|
||||
static QString targetRoot(const QString &qmakePath);
|
||||
static QString targetName(const QString &qmakePath);
|
||||
static QString madCommand(const QString &qmakePath);
|
||||
static QString madDeveloperUiName(const QString &deviceType);
|
||||
static QString deviceType(const QString &qmakePath);
|
||||
static QString madDeveloperUiName(Core::Id deviceType);
|
||||
static Core::Id deviceType(const QString &qmakePath);
|
||||
|
||||
// TODO: IS this still needed with Qt Version having an Abi?
|
||||
static QString architecture(const QString &qmakePath);
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
static bool callMadAdmin(QProcess &proc, const QStringList &args,
|
||||
const QString &qmakePath, bool useTarget);
|
||||
|
||||
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &deviceType);
|
||||
static bool isValidMaemoQtVersion(const QString &qmakePath, Core::Id deviceType);
|
||||
private:
|
||||
static QString madAdminCommand(const QString &qmakePath);
|
||||
static bool callMaddeShellScript(QProcess &proc, const QString &qmakePath,
|
||||
|
||||
@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
|
||||
QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion();
|
||||
if (!lqt)
|
||||
continue;
|
||||
if (MaemoGlobal::deviceType(lqt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
|
||||
if (MaemoGlobal::deviceType(lqt->qmakeCommand().toString()) == Core::Id(Maemo5OsType))
|
||||
m_buildConfigs << qt4Bc;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -84,7 +84,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
|
||||
QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion();
|
||||
if (!qt)
|
||||
continue;
|
||||
if (MaemoGlobal::deviceType(qt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
|
||||
if (MaemoGlobal::deviceType(qt->qmakeCommand().toString()) == Core::Id(Maemo5OsType))
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -124,16 +124,16 @@ QList<ProjectExplorer::Abi> MaemoQtVersion::detectQtAbis() const
|
||||
QList<ProjectExplorer::Abi> result;
|
||||
if (!isValid())
|
||||
return result;
|
||||
if (m_deviceType == QLatin1String(Maemo5OsType)) {
|
||||
if (m_deviceType == Core::Id(Maemo5OsType)) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
|
||||
32));
|
||||
} else if (m_deviceType == QLatin1String(HarmattanOsType)) {
|
||||
} else if (m_deviceType == Core::Id(HarmattanOsType)) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::HarmattanLinuxFlavor,
|
||||
ProjectExplorer::Abi::ElfFormat,
|
||||
32));
|
||||
} else if (m_deviceType == QLatin1String(MeeGoOsType)) {
|
||||
} else if (m_deviceType == Core::Id(MeeGoOsType)) {
|
||||
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
|
||||
ProjectExplorer::Abi::MeegoLinuxFlavor,
|
||||
ProjectExplorer::Abi::ElfFormat, 32));
|
||||
@@ -151,11 +151,11 @@ QSet<Core::Id> MaemoQtVersion::supportedTargetIds() const
|
||||
QSet<Core::Id> result;
|
||||
if (!isValid())
|
||||
return result;
|
||||
if (m_deviceType == QLatin1String(Maemo5OsType)) {
|
||||
if (m_deviceType == Core::Id(Maemo5OsType)) {
|
||||
result.insert(Core::Id(Constants::MAEMO5_DEVICE_TARGET_ID));
|
||||
} else if (m_deviceType == QLatin1String(HarmattanOsType)) {
|
||||
} else if (m_deviceType == Core::Id(HarmattanOsType)) {
|
||||
result.insert(Core::Id(Constants::HARMATTAN_DEVICE_TARGET_ID));
|
||||
} else if (m_deviceType == QLatin1String(MeeGoOsType)) {
|
||||
} else if (m_deviceType == Core::Id(MeeGoOsType)) {
|
||||
result.insert(Core::Id(Constants::MEEGO_DEVICE_TARGET_ID));
|
||||
}
|
||||
return result;
|
||||
@@ -163,11 +163,11 @@ QSet<Core::Id> MaemoQtVersion::supportedTargetIds() const
|
||||
|
||||
QString MaemoQtVersion::description() const
|
||||
{
|
||||
if (m_deviceType == QLatin1String(Maemo5OsType))
|
||||
if (m_deviceType == Core::Id(Maemo5OsType))
|
||||
return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5");
|
||||
else if (m_deviceType == QLatin1String(HarmattanOsType))
|
||||
else if (m_deviceType == Core::Id(HarmattanOsType))
|
||||
return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan");
|
||||
else if (m_deviceType == QLatin1String(MeeGoOsType))
|
||||
else if (m_deviceType == Core::Id(MeeGoOsType))
|
||||
return QCoreApplication::translate("QtVersion", "MeeGo", "Qt Version is meant for MeeGo");
|
||||
return QString();
|
||||
}
|
||||
@@ -180,7 +180,7 @@ bool MaemoQtVersion::supportsShadowBuilds() const
|
||||
return true;
|
||||
}
|
||||
|
||||
QString MaemoQtVersion::deviceType() const
|
||||
Core::Id MaemoQtVersion::deviceType() const
|
||||
{
|
||||
return m_deviceType;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ Core::FeatureSet MaemoQtVersion::availableFeatures() const
|
||||
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO);
|
||||
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE);
|
||||
|
||||
if (deviceType() != QLatin1String(Maemo5OsType)) //Only Maemo5 has proper support for Widgets
|
||||
if (deviceType() != Core::Id(Maemo5OsType)) //Only Maemo5 has proper support for Widgets
|
||||
features.remove(Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS));
|
||||
|
||||
return features;
|
||||
|
||||
@@ -59,14 +59,14 @@ public:
|
||||
QString description() const;
|
||||
|
||||
bool supportsShadowBuilds() const;
|
||||
QString deviceType() const;
|
||||
Core::Id deviceType() const;
|
||||
Core::FeatureSet availableFeatures() const;
|
||||
QString platformName() const;
|
||||
QString platformDisplayName() const;
|
||||
|
||||
private:
|
||||
mutable QString m_systemRoot;
|
||||
mutable QString m_deviceType;
|
||||
mutable Core::Id m_deviceType;
|
||||
mutable bool m_isvalidVersion;
|
||||
mutable bool m_initialized;
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ QString MaemoRunConfiguration::commandPrefix() const
|
||||
return QString();
|
||||
|
||||
QString prefix = environmentPreparationCommand() + QLatin1Char(';');
|
||||
if (deviceConfig()->type() == QLatin1String(MeeGoOsType))
|
||||
if (deviceConfig()->type() == Core::Id(MeeGoOsType))
|
||||
prefix += QLatin1String("DISPLAY=:0.0 ");
|
||||
|
||||
return QString::fromLatin1("%1 %2").arg(prefix, userEnvironmentChangesAsString());
|
||||
|
||||
@@ -1133,7 +1133,7 @@ Qt4Maemo5Target::~Qt4Maemo5Target() {}
|
||||
|
||||
bool Qt4Maemo5Target::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||
{
|
||||
return device->type() == QLatin1String(Maemo5OsType);
|
||||
return device->type() == Core::Id(Maemo5OsType);
|
||||
}
|
||||
|
||||
QString Qt4Maemo5Target::defaultDisplayName()
|
||||
@@ -1177,7 +1177,7 @@ Qt4HarmattanTarget::~Qt4HarmattanTarget() {}
|
||||
|
||||
bool Qt4HarmattanTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||
{
|
||||
return device->type() == QLatin1String(HarmattanOsType);
|
||||
return device->type() == Core::Id(HarmattanOsType);
|
||||
}
|
||||
|
||||
QString Qt4HarmattanTarget::defaultDisplayName()
|
||||
@@ -1253,7 +1253,7 @@ Qt4MeegoTarget::~Qt4MeegoTarget() {}
|
||||
|
||||
bool Qt4MeegoTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||
{
|
||||
return device->type() == QLatin1String(MeeGoOsType);
|
||||
return device->type() == Core::Id(MeeGoOsType);
|
||||
}
|
||||
|
||||
QString Qt4MeegoTarget::defaultDisplayName()
|
||||
|
||||
@@ -74,8 +74,7 @@ IDevice::Ptr DesktopDevice::clone() const
|
||||
return Ptr(new DesktopDevice(*this));
|
||||
}
|
||||
|
||||
DesktopDevice::DesktopDevice() :
|
||||
IDevice(QLatin1String("Desktop"), IDevice::AutoDetected, Id)
|
||||
DesktopDevice::DesktopDevice() : IDevice(Core::Id("Desktop"), IDevice::AutoDetected, Id)
|
||||
{
|
||||
setDisplayName(QCoreApplication::translate("ProjectExplorer::DesktopDevice", "Run locally"));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
static IDevice::Ptr findAutoDetectedDevice(const QList<IDevice::Ptr> &deviceList,
|
||||
const QString &type, const Core::Id id)
|
||||
Core::Id type, const Core::Id id)
|
||||
{
|
||||
foreach (const IDevice::Ptr &device, deviceList) {
|
||||
if (device->isAutoDetected() && device->type() == type && device->id() == id)
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
static DeviceManager *clonedInstance;
|
||||
QList<IDevice::Ptr> devices;
|
||||
QList<IDevice::Ptr> inactiveAutoDetectedDevices;
|
||||
QHash<QString, Core::Id> defaultDevices;
|
||||
QHash<Core::Id, Core::Id> defaultDevices;
|
||||
};
|
||||
DeviceManager *DeviceManagerPrivate::clonedInstance = 0;
|
||||
|
||||
@@ -151,7 +151,7 @@ void DeviceManager::loadPre2_6()
|
||||
const QVariantHash defaultDevsHash = settings->value(QLatin1String("DefaultConfigs")).toHash();
|
||||
for (QVariantHash::ConstIterator it = defaultDevsHash.constBegin();
|
||||
it != defaultDevsHash.constEnd(); ++it) {
|
||||
d->defaultDevices.insert(it.key(), Core::Id(it.value().toString()));
|
||||
d->defaultDevices.insert(Core::Id(it.key()), Core::Id(it.value().toString()));
|
||||
}
|
||||
int count = settings->beginReadArray(QLatin1String("ConfigList"));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
@@ -175,7 +175,7 @@ void DeviceManager::fromMap(const QVariantMap &map)
|
||||
const QVariantMap defaultDevsMap = map.value(QLatin1String(DefaultDevicesKey)).toMap();
|
||||
for (QVariantMap::ConstIterator it = defaultDevsMap.constBegin();
|
||||
it != defaultDevsMap.constEnd(); ++it) {
|
||||
d->defaultDevices.insert(it.key(), Core::Id(it.value().toString()));
|
||||
d->defaultDevices.insert(Core::Id(it.key()), Core::Id(it.value().toString()));
|
||||
}
|
||||
const QVariantList deviceList = map.value(QLatin1String(DeviceListKey)).toList();
|
||||
foreach (const QVariant &v, deviceList) {
|
||||
@@ -196,10 +196,10 @@ QVariantMap DeviceManager::toMap() const
|
||||
{
|
||||
QVariantMap map;
|
||||
QVariantMap defaultDeviceMap;
|
||||
typedef QHash<QString, Core::Id> TypeIdHash;
|
||||
typedef QHash<Core::Id, Core::Id> TypeIdHash;
|
||||
for (TypeIdHash::ConstIterator it = d->defaultDevices.constBegin();
|
||||
it != d->defaultDevices.constEnd(); ++it) {
|
||||
defaultDeviceMap.insert(it.key(), it.value().toString());
|
||||
defaultDeviceMap.insert(it.key().toString(), it.value().toString());
|
||||
}
|
||||
map.insert(QLatin1String(DefaultDevicesKey), defaultDeviceMap);
|
||||
QVariantList deviceList;
|
||||
@@ -271,7 +271,7 @@ void DeviceManager::removeDevice(Core::Id id)
|
||||
QTC_ASSERT(this != instance() || device->isAutoDetected(), return);
|
||||
|
||||
const bool wasDefault = d->defaultDevices.value(device->type()) == device->id();
|
||||
const QString deviceType = device->type();
|
||||
const Core::Id deviceType = device->type();
|
||||
d->devices.removeAt(indexForId(id));
|
||||
emit deviceRemoved(device->id());
|
||||
|
||||
@@ -317,7 +317,7 @@ const IDeviceFactory *DeviceManager::restoreFactory(const QVariantMap &map)
|
||||
return factory;
|
||||
}
|
||||
qWarning("Warning: No factory found for device of type '%s'.",
|
||||
qPrintable(IDevice::typeFromMap(map)));
|
||||
qPrintable(IDevice::typeFromMap(map).toString()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -361,13 +361,12 @@ IDevice::ConstPtr DeviceManager::find(Core::Id id) const
|
||||
return index == -1 ? IDevice::ConstPtr() : deviceAt(index);
|
||||
}
|
||||
|
||||
IDevice::ConstPtr DeviceManager::findInactiveAutoDetectedDevice(const QString &type,
|
||||
Core::Id id)
|
||||
IDevice::ConstPtr DeviceManager::findInactiveAutoDetectedDevice(Core::Id type, Core::Id id)
|
||||
{
|
||||
return findAutoDetectedDevice(d->inactiveAutoDetectedDevices, type, id);
|
||||
}
|
||||
|
||||
IDevice::ConstPtr DeviceManager::defaultDevice(const QString &deviceType) const
|
||||
IDevice::ConstPtr DeviceManager::defaultDevice(Core::Id deviceType) const
|
||||
{
|
||||
const Core::Id id = d->defaultDevices.value(deviceType, IDevice::invalidId());
|
||||
if (id == IDevice::invalidId())
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
IDevice::ConstPtr deviceAt(int index) const;
|
||||
|
||||
IDevice::ConstPtr find(Core::Id id) const;
|
||||
IDevice::ConstPtr findInactiveAutoDetectedDevice(const QString &type, Core::Id id);
|
||||
IDevice::ConstPtr defaultDevice(const QString &deviceType) const;
|
||||
IDevice::ConstPtr findInactiveAutoDetectedDevice(Core::Id type, Core::Id id);
|
||||
IDevice::ConstPtr defaultDevice(Core::Id deviceType) const;
|
||||
bool hasDevice(const QString &name) const;
|
||||
Core::Id deviceId(const IDevice::ConstPtr &device) const;
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
{ }
|
||||
|
||||
QString displayName;
|
||||
QString type;
|
||||
Core::Id type;
|
||||
IDevice::Origin origin;
|
||||
Core::Id id;
|
||||
IDevice::AvailabilityState availability;
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
IDevice::IDevice() : d(new Internal::IDevicePrivate)
|
||||
{ }
|
||||
|
||||
IDevice::IDevice(const QString &type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate)
|
||||
IDevice::IDevice(Core::Id type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate)
|
||||
{
|
||||
d->type = type;
|
||||
d->origin = origin;
|
||||
@@ -216,7 +216,7 @@ IDevice::DeviceInfo IDevice::deviceInformation() const
|
||||
return result;
|
||||
}
|
||||
|
||||
QString IDevice::type() const
|
||||
Core::Id IDevice::type() const
|
||||
{
|
||||
return d->type;
|
||||
}
|
||||
@@ -248,9 +248,9 @@ Core::Id IDevice::invalidId()
|
||||
return Core::Id();
|
||||
}
|
||||
|
||||
QString IDevice::typeFromMap(const QVariantMap &map)
|
||||
Core::Id IDevice::typeFromMap(const QVariantMap &map)
|
||||
{
|
||||
return map.value(QLatin1String(TypeKey)).toString();
|
||||
return Core::Id(map.value(QLatin1String(TypeKey)).toByteArray().constData());
|
||||
}
|
||||
|
||||
Core::Id IDevice::idFromMap(const QVariantMap &map)
|
||||
@@ -270,7 +270,7 @@ QVariantMap IDevice::toMap() const
|
||||
{
|
||||
QVariantMap map;
|
||||
map.insert(QLatin1String(DisplayNameKey), d->displayName);
|
||||
map.insert(QLatin1String(TypeKey), d->type);
|
||||
map.insert(QLatin1String(TypeKey), d->type.name());
|
||||
map.insert(QLatin1String(IdKey), d->id.name());
|
||||
map.insert(QLatin1String(OriginKey), d->origin);
|
||||
return map;
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
typedef QList<DeviceInfoItem> DeviceInfo;
|
||||
virtual DeviceInfo deviceInformation() const;
|
||||
|
||||
QString type() const;
|
||||
Core::Id type() const;
|
||||
bool isAutoDetected() const;
|
||||
Core::Id id() const;
|
||||
|
||||
@@ -94,12 +94,12 @@ public:
|
||||
|
||||
static Core::Id invalidId();
|
||||
|
||||
static QString typeFromMap(const QVariantMap &map);
|
||||
static Core::Id typeFromMap(const QVariantMap &map);
|
||||
static Core::Id idFromMap(const QVariantMap &map);
|
||||
|
||||
protected:
|
||||
IDevice();
|
||||
IDevice(const QString &type, Origin origin, Core::Id id = Core::Id());
|
||||
IDevice(Core::Id type, Origin origin, Core::Id id = Core::Id());
|
||||
IDevice(const IDevice &other);
|
||||
|
||||
Ptr sharedFromThis();
|
||||
|
||||
@@ -69,9 +69,9 @@ ProjectExplorer::IDevice::Ptr SymbianIDeviceFactory::restore(const QVariantMap &
|
||||
return ProjectExplorer::IDevice::Ptr(dev);
|
||||
}
|
||||
|
||||
QString SymbianIDeviceFactory::deviceType()
|
||||
Core::Id SymbianIDeviceFactory::deviceType()
|
||||
{
|
||||
return QLatin1String("Qt4ProjectManager.SymbianDevice");
|
||||
return Core::Id("Qt4ProjectManager.SymbianDevice");
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
bool canRestore(const QVariantMap &map) const;
|
||||
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
|
||||
|
||||
static QString deviceType();
|
||||
static Core::Id deviceType();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -74,7 +74,7 @@ Utils::FileName GenericEmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4B
|
||||
|
||||
bool GenericEmbeddedLinuxTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||
{
|
||||
return device->type() == QLatin1String(Constants::GenericLinuxOsType);
|
||||
return device->type() == Core::Id(Constants::GenericLinuxOsType);
|
||||
}
|
||||
|
||||
void GenericEmbeddedLinuxTarget::createApplicationProFiles(bool reparse)
|
||||
|
||||
@@ -66,7 +66,7 @@ IDevice::Ptr GenericLinuxDeviceConfigurationFactory::create() const
|
||||
|
||||
bool GenericLinuxDeviceConfigurationFactory::canRestore(const QVariantMap &map) const
|
||||
{
|
||||
return IDevice::typeFromMap(map) == QLatin1String(Constants::GenericLinuxOsType);
|
||||
return IDevice::typeFromMap(map) == Core::Id(Constants::GenericLinuxOsType);
|
||||
}
|
||||
|
||||
IDevice::Ptr GenericLinuxDeviceConfigurationFactory::restore(const QVariantMap &map) const
|
||||
|
||||
@@ -87,7 +87,7 @@ IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device()
|
||||
else
|
||||
sshParams.privateKeyFile = d->setupPage.privateKeyFilePath();
|
||||
LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(d->setupPage.configurationName(),
|
||||
QLatin1String(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Hardware);
|
||||
Core::Id(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Hardware);
|
||||
devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
||||
devConf->setSshParameters(sshParams);
|
||||
LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this);
|
||||
|
||||
@@ -84,7 +84,7 @@ LinuxDeviceConfiguration::~LinuxDeviceConfiguration()
|
||||
}
|
||||
|
||||
LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QString &name,
|
||||
const QString &type, MachineType machineType, Origin origin, Core::Id id)
|
||||
Core::Id type, MachineType machineType, Origin origin, Core::Id id)
|
||||
{
|
||||
return Ptr(new LinuxDeviceConfiguration(name, type, machineType, origin, id));
|
||||
}
|
||||
@@ -141,7 +141,7 @@ LinuxDeviceConfiguration::LinuxDeviceConfiguration() : d(new LinuxDeviceConfigur
|
||||
{
|
||||
}
|
||||
|
||||
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, const QString &type,
|
||||
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, Core::Id type,
|
||||
MachineType machineType, Origin origin, Core::Id id)
|
||||
: IDevice(type, origin, id), d(new LinuxDeviceConfigurationPrivate)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
static QString defaultPublicKeyFilePath();
|
||||
|
||||
static Ptr create();
|
||||
static Ptr create(const QString &name, const QString &type, MachineType machineType,
|
||||
static Ptr create(const QString &name, Core::Id type, MachineType machineType,
|
||||
Origin origin = ManuallyAdded, Core::Id id = Core::Id());
|
||||
|
||||
QString displayType() const;
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
protected:
|
||||
LinuxDeviceConfiguration();
|
||||
LinuxDeviceConfiguration(const QString &name, const QString &type, MachineType machineType,
|
||||
LinuxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType,
|
||||
Origin origin, Core::Id id);
|
||||
LinuxDeviceConfiguration(const LinuxDeviceConfiguration &other);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user