diff --git a/src/plugins/madde/maddedevice.cpp b/src/plugins/madde/maddedevice.cpp index e974829be279bbf449b18745fdbf68b0bbf034db..1b5e03187b47755cd0353a6efd1257f98141beaa 100644 --- a/src/plugins/madde/maddedevice.cpp +++ b/src/plugins/madde/maddedevice.cpp @@ -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"); } diff --git a/src/plugins/madde/maddedevice.h b/src/plugins/madde/maddedevice.h index 716e8155fe68fc82edc40e0fbd9cf58872290238..c508cc641d9a0c7680fb9350e01d4789ae9f76fb 100644 --- a/src/plugins/madde/maddedevice.h +++ b/src/plugins/madde/maddedevice.h @@ -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); diff --git a/src/plugins/madde/maddedeviceconfigurationfactory.cpp b/src/plugins/madde/maddedeviceconfigurationfactory.cpp index d7cdddc588dbb249090bf73d69fad68655de94c7..0f550e1b66561dd704d369f8660880b414bf2e70 100644 --- a/src/plugins/madde/maddedeviceconfigurationfactory.cpp +++ b/src/plugins/madde/maddedeviceconfigurationfactory.cpp @@ -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 diff --git a/src/plugins/madde/maddedevicetester.cpp b/src/plugins/madde/maddedevicetester.cpp index c1d80ecfeaf8dd0eef9304056dddf478756279ce..3fa4b96189a7cf4658d2fee09532a99573fc2422 100644 --- a/src/plugins/madde/maddedevicetester.cpp +++ b/src/plugins/madde/maddedevicetester.cpp @@ -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+"); diff --git a/src/plugins/madde/maemodeviceconfigwizard.cpp b/src/plugins/madde/maemodeviceconfigwizard.cpp index f16fd901fdb4090b3282100c220cf4eaedebb65c..0db737173e09d12274b18a47bb53030a2331ff08 100644 --- a/src/plugins/madde/maemodeviceconfigwizard.cpp +++ b/src/plugins/madde/maemodeviceconfigwizard.cpp @@ -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"); diff --git a/src/plugins/madde/maemoglobal.cpp b/src/plugins/madde/maemoglobal.cpp index 6278e981e29f96a7489abb4f953f714d1034b43a..ae1f73f34f02e4b5b41a589d8359cf6be9725930 100644 --- a/src/plugins/madde/maemoglobal.cpp +++ b/src/plugins/madde/maemoglobal.cpp @@ -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) diff --git a/src/plugins/madde/maemoglobal.h b/src/plugins/madde/maemoglobal.h index 09ad361381846364cb0f163335020c6fe2876311..2e519b54f63c7ee60bcc2199cb45aa7bfb876c92 100644 --- a/src/plugins/madde/maemoglobal.h +++ b/src/plugins/madde/maemoglobal.h @@ -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, diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp index 4d6fa1e1381c98c527089194ab9bb187f5f90667..5c04ae126e80a2695d91a9d6f3c046a85fe11e38 100644 --- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp +++ b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp @@ -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; diff --git a/src/plugins/madde/maemopublishingwizardfactories.cpp b/src/plugins/madde/maemopublishingwizardfactories.cpp index ef51f713710d52c80d96210bbf59848366128e96..57493149638f832710939626cf080756a655cada 100644 --- a/src/plugins/madde/maemopublishingwizardfactories.cpp +++ b/src/plugins/madde/maemopublishingwizardfactories.cpp @@ -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; diff --git a/src/plugins/madde/maemoqtversion.cpp b/src/plugins/madde/maemoqtversion.cpp index f8524bc5e49b5fdc6375ee034c0f7110a383c900..074dfac6fbe6f24153f1d723329de86417360e56 100644 --- a/src/plugins/madde/maemoqtversion.cpp +++ b/src/plugins/madde/maemoqtversion.cpp @@ -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; diff --git a/src/plugins/madde/maemoqtversion.h b/src/plugins/madde/maemoqtversion.h index 8b48489261ca58679290481b437718a93830a5b3..6dca2178919b795a8a1a7625013d6fc24ffc235e 100644 --- a/src/plugins/madde/maemoqtversion.h +++ b/src/plugins/madde/maemoqtversion.h @@ -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; }; diff --git a/src/plugins/madde/maemorunconfiguration.cpp b/src/plugins/madde/maemorunconfiguration.cpp index 152ccc2ea452844cc47016cf32c829cee7fe6cd1..c71bb6ba2879b3dab10f66aad305320172ff0e56 100644 --- a/src/plugins/madde/maemorunconfiguration.cpp +++ b/src/plugins/madde/maemorunconfiguration.cpp @@ -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()); diff --git a/src/plugins/madde/qt4maemotarget.cpp b/src/plugins/madde/qt4maemotarget.cpp index d6f5327244ba39a667e3cdf6537b05a3dcc27374..61e59c2d4fe5571aa1195574055a403455d1d1dd 100644 --- a/src/plugins/madde/qt4maemotarget.cpp +++ b/src/plugins/madde/qt4maemotarget.cpp @@ -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() diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 842bea2764479e914a90b5c2dcd83c49660cc9bd..26d50dac49fa2a15aefc282c74667323812524b5 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -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")); } diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 930f856777d1bc2773cc2b8a1edeea7e71de09e3..0c0f73d7a281223eb94ac9788c9e8a4c85598e47 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -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()) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index c7cfe2eb03f7697f8542d05c1a37b51da798b24a..141cd9bde64ea6aee4207b3b12ef4930f08e5c17 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -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; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 703aaebf3157f5c2aa1c0a14dbea907bf589c45a..919daf722afd29430e67c95080b27b5bc380026f 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -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; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 7245299bc3ee44944c926993640828da616d1968..a9369a22d09dd52d746cc1667a1a6243f88639d3 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -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(); diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp index 2de4a5e609700ee842b4024910c712c37fd7ae5f..db3d93a7880d81c8c156f71f7504f7f7f5660f00 100644 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp @@ -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 diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h index 225a3f9ca41b9bf42114ee93d642e4e655e4517e..2b4e5340cb3ce7cff879e0925f4dda758e9d1898 100644 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h +++ b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h @@ -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 diff --git a/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp index 39e600d16431ca323c539c368c0a2c89f9040e83..978504c219412643c4a35eaeab13295570fce716 100644 --- a/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp +++ b/src/plugins/remotelinux/genericembeddedlinuxtarget.cpp @@ -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) diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.cpp index 670e8653f35f085bac9c6e2613145ce5c445b519..163939b1b39a96ca42b565fb97dfe861b52ff3af 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.cpp @@ -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 diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp index 4590ee29a3f69b49458eeb21b8b0a3efe5c453c3..6d8be5cd03c4dfc92079756c364c029253946130 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.cpp @@ -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); diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.cpp b/src/plugins/remotelinux/linuxdeviceconfiguration.cpp index 040023ad4a6cf9bb190ec6bec657fb1bd1aa1836..a478926755f7265e38c8c428c67ba7ceaabd681c 100644 --- a/src/plugins/remotelinux/linuxdeviceconfiguration.cpp +++ b/src/plugins/remotelinux/linuxdeviceconfiguration.cpp @@ -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) { diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.h b/src/plugins/remotelinux/linuxdeviceconfiguration.h index f70e28cc8acd843da7a9c9db6f7dd34d39caa514..6fa22eb9be02b80dc1d8f7fec69c24c4315845a3 100644 --- a/src/plugins/remotelinux/linuxdeviceconfiguration.h +++ b/src/plugins/remotelinux/linuxdeviceconfiguration.h @@ -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);