Commit effe56ef authored by Christian Kandeler's avatar Christian Kandeler
Browse files

RemoteLinux: More preparations for introducing an abstract device class.



- Introduce clone() method.
- Rename "osType" to "type" and "deviceType" to "machineType".
- Move machine type display out of generic settings widget.
- Put only immutable attributes into the device constructor and set the
others via setters. As part of this, also give the
SshConnectionParameters a default proxy type. The necessity to give one
to the constructor explicitly was for historical reasons.

Change-Id: I84757b1b2d6371544b9ab1f3290973e5498176ce
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent be1afbd6
......@@ -84,8 +84,8 @@ namespace {
} // anonymous namespace
SshConnectionParameters::SshConnectionParameters(ProxyType proxyType) :
timeout(0), authenticationType(AuthenticationByKey), port(0), proxyType(proxyType)
SshConnectionParameters::SshConnectionParameters() :
timeout(0), authenticationType(AuthenticationByKey), port(0), proxyType(NoProxy)
{
}
......
......@@ -56,7 +56,7 @@ class QTCREATOR_UTILS_EXPORT SshConnectionParameters
public:
enum ProxyType { DefaultProxy, NoProxy };
enum AuthenticationType { AuthenticationByPassword, AuthenticationByKey };
SshConnectionParameters(ProxyType proxyType);
SshConnectionParameters();
QString host;
QString userName;
......
......@@ -51,7 +51,6 @@ class ANALYZER_EXPORT AnalyzerStartParameters
{
public:
AnalyzerStartParameters()
: connParams(Utils::SshConnectionParameters::NoProxy)
{}
StartMode startMode;
......
......@@ -115,7 +115,7 @@ void StartRemoteDialog::validate()
Utils::SshConnectionParameters StartRemoteDialog::sshParams() const
{
Utils::SshConnectionParameters params(Utils::SshConnectionParameters::NoProxy);
Utils::SshConnectionParameters params;
params.host = m_ui->host->text();
params.userName = m_ui->user->text();
if (m_ui->keyFile->isValid()) {
......
......@@ -65,7 +65,6 @@ public:
qmlServerAddress(QLatin1String("127.0.0.1")),
qmlServerPort(ProjectExplorer::Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
useServerStartScript(false),
connParams(Utils::SshConnectionParameters::NoProxy),
requestRemoteSetup(false),
startMode(NoStartMode),
executableUid(0),
......
......@@ -74,18 +74,18 @@ ILinuxDeviceConfigurationWidget *MaddeDeviceConfigurationFactory::createWidget(
return new GenericLinuxDeviceConfigurationWidget(deviceConfig, parent);
}
bool MaddeDeviceConfigurationFactory::supportsOsType(const QString &osType) const
bool MaddeDeviceConfigurationFactory::supportsDeviceType(const QString &type) const
{
return osType == QLatin1String(Maemo5OsType) || osType == QLatin1String(HarmattanOsType)
|| osType == QLatin1String(MeeGoOsType);
return type == QLatin1String(Maemo5OsType) || type == QLatin1String(HarmattanOsType)
|| type == QLatin1String(MeeGoOsType);
}
QString MaddeDeviceConfigurationFactory::displayNameForOsType(const QString &osType) const
QString MaddeDeviceConfigurationFactory::displayType(const QString &deviceType) const
{
QTC_ASSERT(supportsOsType(osType), return QString());
if (osType == QLatin1String(Maemo5OsType))
QTC_ASSERT(supportsDeviceType(deviceType), return QString());
if (deviceType == QLatin1String(Maemo5OsType))
return tr("Maemo5/Fremantle");
if (osType == QLatin1String(HarmattanOsType))
if (deviceType == QLatin1String(HarmattanOsType))
return tr("MeeGo 1.2 Harmattan");
return tr("Other MeeGo OS");
}
......
......@@ -48,8 +48,8 @@ public:
RemoteLinux::ILinuxDeviceConfigurationWidget *createWidget(
const RemoteLinux::LinuxDeviceConfiguration::Ptr &deviceConfig,
QWidget *parent = 0) const;
bool supportsOsType(const QString &osType) const;
QString displayNameForOsType(const QString &osType) const;
bool supportsDeviceType(const QString &type) const;
QString displayType(const QString &deviceType) const;
QStringList supportedDeviceActionIds() const;
QString displayNameForActionId(const QString &actionId) const;
QDialog *createDeviceAction(const QString &actionId,
......
......@@ -117,7 +117,7 @@ void MaddeDeviceTester::handleGenericTestFinished(TestResult result)
connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int)));
QString qtInfoCmd;
if (m_deviceConfiguration->osType() == QLatin1String(MeeGoOsType)) {
if (m_deviceConfiguration->type() == QLatin1String(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->osType() == QLatin1String(HarmattanOsType)) {
if (m_deviceConfiguration->type() == QLatin1String(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->osType() != QLatin1String(HarmattanOsType)) {
if (m_deviceConfiguration->type() != QLatin1String(HarmattanOsType)) {
setFinished();
return;
}
......@@ -263,7 +263,7 @@ QString MaddeDeviceTester::processedQtLibsList()
QString unfilteredLibs = QString::fromUtf8(m_stdout);
QString filteredLibs;
QString patternString;
if (m_deviceConfiguration->osType() == QLatin1String(MeeGoOsType))
if (m_deviceConfiguration->type() == QLatin1String(MeeGoOsType))
patternString = QLatin1String("(libqt\\S+) ((\\d+)\\.(\\d+)\\.(\\d+))");
else
patternString = QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+");
......
......@@ -61,7 +61,7 @@ protected:
void doDeviceSetup()
{
if (deviceConfiguration()->deviceType() == LinuxDeviceConfiguration::Hardware) {
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Hardware) {
handleDeviceSetupDone(true);
return;
}
......
......@@ -157,7 +157,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup()
{
QTC_ASSERT(m_state == Inactive, return);
if (deviceConfiguration()->deviceType() == LinuxDeviceConfiguration::Hardware) {
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Hardware) {
handleDeviceSetupDone(true);
return;
}
......
......@@ -147,7 +147,7 @@ void MaemoDeployConfigurationWidget::addIcon()
{
DeployableFilesPerProFile * const proFileInfo = m_remoteLinuxWidget->currentModel();
const int iconDim
= MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedOsType());
= MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedDeviceType());
const QString origFilePath = QFileDialog::getOpenFileName(this,
tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim),
proFileInfo->projectDir(), QLatin1String("(*.png)"));
......@@ -212,7 +212,7 @@ QString MaemoDeployConfigurationWidget::remoteIconFilePath(const DeployableFiles
QString MaemoDeployConfigurationWidget::remoteIconDir() const
{
return QString::fromLatin1("/usr/share/icons/hicolor/%1x%1/apps")
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedOsType()));
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedDeviceType()));
}
} // namespace Internal
......
......@@ -61,14 +61,14 @@ namespace Madde {
namespace Internal {
namespace {
QString defaultUser(const QString &osType)
QString defaultUser(const QString &deviceType)
{
if (osType == QLatin1String(MeeGoOsType))
if (deviceType == QLatin1String(MeeGoOsType))
return QLatin1String("meego");
return QLatin1String("developer");
}
QString defaultHost(LinuxDeviceConfiguration::DeviceType type)
QString defaultHost(LinuxDeviceConfiguration::MachineType type)
{
return QLatin1String(type == LinuxDeviceConfiguration::Hardware ? "192.168.2.15" : "localhost");
}
......@@ -77,9 +77,9 @@ struct WizardData
{
QString configName;
QString hostName;
QString osType;
QString deviceType;
SshConnectionParameters::AuthenticationType authType;
LinuxDeviceConfiguration::DeviceType deviceType;
LinuxDeviceConfiguration::MachineType machineType;
QString privateKeyFilePath;
QString publicKeyFilePath;
QString userName;
......@@ -104,25 +104,24 @@ public:
setTitle(tr("General Information"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::osTypeToString(QLatin1String(Maemo5OsType)),
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::displayType(QLatin1String(Maemo5OsType)),
QLatin1String(Maemo5OsType));
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::osTypeToString(QLatin1String(HarmattanOsType)),
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::displayType(QLatin1String(HarmattanOsType)),
QLatin1String(HarmattanOsType));
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::osTypeToString(QLatin1String(MeeGoOsType)),
m_ui->osTypeComboBox->addItem(RemoteLinuxUtils::displayType(QLatin1String(MeeGoOsType)),
QLatin1String(MeeGoOsType));
QButtonGroup *buttonGroup = new QButtonGroup(this);
buttonGroup->setExclusive(true);
buttonGroup->addButton(m_ui->hwButton);
buttonGroup->addButton(m_ui->emulatorButton);
connect(buttonGroup, SIGNAL(buttonClicked(int)),
SLOT(handleDeviceTypeChanged()));
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->hwButton->setChecked(true);
handleDeviceTypeChanged();
m_ui->hostNameLineEdit->setText(defaultHost(deviceType()));
handleMachineTypeChanged();
m_ui->hostNameLineEdit->setText(defaultHost(machineType()));
m_ui->sshPortSpinBox->setMinimum(1);
m_ui->sshPortSpinBox->setMaximum(65535);
m_ui->sshPortSpinBox->setValue(22);
......@@ -141,17 +140,17 @@ public:
QString hostName() const
{
return deviceType() == LinuxDeviceConfiguration::Emulator
return machineType() == LinuxDeviceConfiguration::Emulator
? defaultHost(LinuxDeviceConfiguration::Emulator)
: m_ui->hostNameLineEdit->text().trimmed();
}
QString osType() const
QString deviceType() const
{
return m_ui->osTypeComboBox->itemData(m_ui->osTypeComboBox->currentIndex()).toString();
}
LinuxDeviceConfiguration::DeviceType deviceType() const
LinuxDeviceConfiguration::MachineType machineType() const
{
return m_ui->hwButton->isChecked()
? LinuxDeviceConfiguration::Hardware : LinuxDeviceConfiguration::Emulator;
......@@ -159,14 +158,14 @@ public:
int sshPort() const
{
return deviceType() == LinuxDeviceConfiguration::Emulator
return machineType() == LinuxDeviceConfiguration::Emulator
? 6666 : m_ui->sshPortSpinBox->value();
}
private slots:
void handleDeviceTypeChanged()
void handleMachineTypeChanged()
{
const bool enable = deviceType() == LinuxDeviceConfiguration::Hardware;
const bool enable = machineType() == LinuxDeviceConfiguration::Hardware;
m_ui->hostNameLabel->setEnabled(enable);
m_ui->hostNameLineEdit->setEnabled(enable);
m_ui->sshPortLabel->setEnabled(enable);
......@@ -422,7 +421,7 @@ public:
m_ui->deviceAddressLineEdit->setText(m_wizardData.hostName);
m_ui->instructionLabel->setText(QString(m_instructionTextTemplate)
.replace(QLatin1String("%%%maddev%%%"),
MaemoGlobal::madDeveloperUiName(m_wizardData.osType)));
MaemoGlobal::madDeveloperUiName(m_wizardData.deviceType)));
m_ui->passwordLineEdit->clear();
enableInput();
}
......@@ -446,13 +445,13 @@ private:
m_ui->deviceAddressLineEdit->setEnabled(false);
m_ui->passwordLineEdit->setEnabled(false);
m_ui->deployButton->setEnabled(false);
SshConnectionParameters sshParams(SshConnectionParameters::NoProxy);
SshConnectionParameters sshParams;
sshParams.authenticationType = SshConnectionParameters::AuthenticationByPassword;
sshParams.host = hostAddress();
sshParams.port = m_wizardData.sshPort;
sshParams.password = password();
sshParams.timeout = 10;
sshParams.userName = defaultUser(m_wizardData.osType);
sshParams.userName = defaultUser(m_wizardData.deviceType);
m_ui->statusLabel->setText(tr("Deploying... "));
m_keyDeployer->deployPublicKey(sshParams, m_wizardData.publicKeyFilePath);
}
......@@ -468,7 +467,7 @@ private:
QMessageBox::information(this, tr("Key Deployment Success"),
tr("The key was successfully deployed. You may now close "
"the \"%1\" application and continue.")
.arg(MaemoGlobal::madDeveloperUiName(m_wizardData.osType)));
.arg(MaemoGlobal::madDeveloperUiName(m_wizardData.deviceType)));
m_ui->statusLabel->setText(m_ui->statusLabel->text() + tr("Done."));
m_isComplete = true;
emit completeChanged();
......@@ -506,7 +505,7 @@ public:
private:
QString infoText() const
{
if (m_wizardData.deviceType == LinuxDeviceConfiguration::Emulator)
if (m_wizardData.machineType == LinuxDeviceConfiguration::Emulator)
return tr("The new device configuration will now be created.");
return GenericLinuxDeviceConfigurationWizardFinalPage::infoText();
}
......@@ -560,13 +559,13 @@ LinuxDeviceConfiguration::Ptr MaemoDeviceConfigWizard::deviceConfiguration()
{
bool doTest;
QString freePortsSpec;
Utils::SshConnectionParameters sshParams(Utils::SshConnectionParameters::NoProxy);
sshParams.userName = defaultUser(d->wizardData.osType);
Utils::SshConnectionParameters sshParams;
sshParams.userName = defaultUser(d->wizardData.deviceType);
sshParams.host = d->wizardData.hostName;
sshParams.port = d->wizardData.sshPort;
if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator) {
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator) {
sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
sshParams.password = d->wizardData.osType == QLatin1String(MeeGoOsType)
sshParams.password = d->wizardData.deviceType == QLatin1String(MeeGoOsType)
? QLatin1String("meego") : QString();
sshParams.timeout = 30;
freePortsSpec = QLatin1String("13219,14168");
......@@ -579,8 +578,9 @@ LinuxDeviceConfiguration::Ptr MaemoDeviceConfigWizard::deviceConfiguration()
doTest = true;
}
const LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(d->wizardData.configName,
d->wizardData.osType, d->wizardData.deviceType, PortList::fromString(freePortsSpec),
sshParams);
d->wizardData.deviceType, d->wizardData.machineType);
devConf->setFreePorts(PortList::fromString(freePortsSpec));
devConf->setSshParameters(sshParams);
if (doTest) {
LinuxDeviceTestDialog dlg(devConf, new MaddeDeviceTester(this), this);
dlg.exec();
......@@ -593,11 +593,11 @@ int MaemoDeviceConfigWizard::nextId() const
switch (currentId()) {
case StartPageId:
d->wizardData.configName = d->startPage.configName();
d->wizardData.osType = d->startPage.osType();
d->wizardData.deviceType = d->startPage.deviceType();
d->wizardData.machineType = d->startPage.machineType();
d->wizardData.hostName = d->startPage.hostName();
d->wizardData.sshPort = d->startPage.sshPort();
if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator)
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator)
return FinalPageId;
return PreviousKeySetupCheckPageId;
case PreviousKeySetupCheckPageId:
......
......@@ -92,9 +92,9 @@ bool MaemoGlobal::isValidMeegoQtVersion(const QString &qmakePath)
return isValidMaemoQtVersion(qmakePath, QLatin1String(MeeGoOsType));
}
bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath, const QString &osType)
bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath, const QString &deviceType)
{
if (MaemoGlobal::osType(qmakePath) != osType)
if (MaemoGlobal::deviceType(qmakePath) != deviceType)
return false;
QProcess madAdminProc;
const QStringList arguments(QLatin1String("list"));
......@@ -127,17 +127,17 @@ QString MaemoGlobal::devrootshPath()
return QLatin1String("/usr/lib/mad-developer/devrootsh");
}
int MaemoGlobal::applicationIconSize(const QString &osType)
int MaemoGlobal::applicationIconSize(const QString &deviceType)
{
return osType == QLatin1String(HarmattanOsType) ? 80 : 64;
return deviceType == QLatin1String(HarmattanOsType) ? 80 : 64;
}
QString MaemoGlobal::remoteSudo(const QString &osType, const QString &uname)
QString MaemoGlobal::remoteSudo(const QString &deviceType, const QString &uname)
{
if (uname == QLatin1String("root"))
return QString();
if (osType == QLatin1String(Maemo5OsType) || osType == QLatin1String(HarmattanOsType)
|| osType == QLatin1String(MeeGoOsType)) {
if (deviceType == QLatin1String(Maemo5OsType) || deviceType == QLatin1String(HarmattanOsType)
|| deviceType == QLatin1String(MeeGoOsType)) {
return devrootshPath();
}
return QString(); // Using sudo would open a can of worms.
......@@ -158,7 +158,7 @@ Utils::PortList MaemoGlobal::freePorts(const LinuxDeviceConfiguration::ConstPtr
{
if (!devConf || !qtVersion)
return Utils::PortList();
if (devConf->deviceType() == LinuxDeviceConfiguration::Emulator) {
if (devConf->machineType() == LinuxDeviceConfiguration::Emulator) {
MaemoQemuRuntime rt;
const int id = qtVersion->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))
......@@ -199,13 +199,13 @@ QString MaemoGlobal::madCommand(const QString &qmakePath)
return maddeRoot(qmakePath) + QLatin1String("/bin/mad");
}
QString MaemoGlobal::madDeveloperUiName(const QString &osType)
QString MaemoGlobal::madDeveloperUiName(const QString &deviceType)
{
return osType == QLatin1String(HarmattanOsType)
return deviceType == QLatin1String(HarmattanOsType)
? tr("SDK Connectivity") : tr("Mad Developer");
}
QString MaemoGlobal::osType(const QString &qmakePath)
QString MaemoGlobal::deviceType(const QString &qmakePath)
{
const QString &name = targetName(qmakePath);
if (name.startsWith(QLatin1String("fremantle")))
......
......@@ -97,8 +97,8 @@ public:
static QString homeDirOnDevice(const QString &uname);
static QString devrootshPath();
static int applicationIconSize(const QString &osType);
static QString remoteSudo(const QString &osType, const QString &uname);
static int applicationIconSize(const QString &deviceType);
static QString remoteSudo(const QString &deviceType, const QString &uname);
static QString remoteSourceProfilesCommand();
static Utils::PortList freePorts(const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
const QtSupport::BaseQtVersion *qtVersion);
......@@ -109,8 +109,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 &osType);
static QString osType(const QString &qmakePath);
static QString madDeveloperUiName(const QString &deviceType);
static QString deviceType(const QString &qmakePath);
// TODO: IS this still needed with Qt Version having an Abi?
static QString architecture(const QString &qmakePath);
......@@ -120,7 +120,7 @@ public:
static bool callMadAdmin(QProcess &proc, const QStringList &args,
const QString &qmakePath, bool useTarget);
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &osType);
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &deviceType);
private:
static QString madAdminCommand(const QString &qmakePath);
static bool callMaddeShellScript(QProcess &proc, const QString &qmakePath,
......
......@@ -69,7 +69,6 @@ MaemoPublisherFremantleFree::MaemoPublisherFremantleFree(const ProjectExplorer::
QObject(parent),
m_project(project),
m_state(Inactive),
m_sshParams(SshConnectionParameters::DefaultProxy),
m_uploader(0)
{
m_sshParams.authenticationType = SshConnectionParameters::AuthenticationByKey;
......
......@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion();
if (!lqt)
continue;
if (MaemoGlobal::osType(lqt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
if (MaemoGlobal::deviceType(lqt->qmakeCommand().toString()) == QLatin1String(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::osType(qt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
if (MaemoGlobal::deviceType(qt->qmakeCommand().toString()) == QLatin1String(Maemo5OsType))
return true;
}
break;
......
......@@ -591,7 +591,7 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
if (qtVersion)
*qtVersion = version;
const LinuxDeviceConfiguration::ConstPtr &config = mrc->deviceConfig();
return config && config->deviceType() == LinuxDeviceConfiguration::Emulator;
return config && config->machineType() == LinuxDeviceConfiguration::Emulator;
}
void MaemoQemuManager::notify(const QList<int> uniqueIds)
......
......@@ -57,7 +57,7 @@ MaemoQtVersion::MaemoQtVersion()
MaemoQtVersion::MaemoQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
m_osType(MaemoGlobal::osType(path.toString())),
m_deviceType(MaemoGlobal::deviceType(path.toString())),
m_isvalidVersion(false),
m_initialized(false)
{
......@@ -73,7 +73,7 @@ void MaemoQtVersion::fromMap(const QVariantMap &map)
{
QtSupport::BaseQtVersion::fromMap(map);
QString path = qmakeCommand().toString();
m_osType = MaemoGlobal::osType(path);
m_deviceType = MaemoGlobal::deviceType(path);
}
QString MaemoQtVersion::type() const
......@@ -86,7 +86,7 @@ bool MaemoQtVersion::isValid() const
if (!BaseQtVersion::isValid())
return false;
if (!m_initialized) {
m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(qmakeCommand().toString(), m_osType);
m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(qmakeCommand().toString(), m_deviceType);
m_initialized = true;
}
return m_isvalidVersion;
......@@ -124,16 +124,16 @@ QList<ProjectExplorer::Abi> MaemoQtVersion::detectQtAbis() const
QList<ProjectExplorer::Abi> result;
if (!isValid())
return result;
if (m_osType == QLatin1String(Maemo5OsType)) {
if (m_deviceType == QLatin1String(Maemo5OsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
32));
} else if (m_osType == QLatin1String(HarmattanOsType)) {
} else if (m_deviceType == QLatin1String(HarmattanOsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::HarmattanLinuxFlavor,
ProjectExplorer::Abi::ElfFormat,
32));
} else if (m_osType == QLatin1String(MeeGoOsType)) {
} else if (m_deviceType == QLatin1String(MeeGoOsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::MeegoLinuxFlavor,
ProjectExplorer::Abi::ElfFormat, 32));
......@@ -151,11 +151,11 @@ QSet<QString> MaemoQtVersion::supportedTargetIds() const
QSet<QString> result;
if (!isValid())
return result;
if (m_osType == QLatin1String(Maemo5OsType)) {
if (m_deviceType == QLatin1String(Maemo5OsType)) {
result.insert(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID));
} else if (m_osType == QLatin1String(HarmattanOsType)) {
} else if (m_deviceType == QLatin1String(HarmattanOsType)) {
result.insert(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID));
} else if (m_osType == QLatin1String(MeeGoOsType)) {
} else if (m_deviceType == QLatin1String(MeeGoOsType)) {
result.insert(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID));
}
return result;
......@@ -163,11 +163,11 @@ QSet<QString> MaemoQtVersion::supportedTargetIds() const
QString MaemoQtVersion::description() const
{
if (m_osType == QLatin1String(Maemo5OsType))
if (m_deviceType == QLatin1String(Maemo5OsType))
return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5");
else if (m_osType == QLatin1String(HarmattanOsType))
else if (m_deviceType == QLatin1String(HarmattanOsType))
return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan");
else if (m_osType == QLatin1String(MeeGoOsType))
else if (m_deviceType == QLatin1String(MeeGoOsType))
return QCoreApplication::translate("QtVersion", "MeeGo", "Qt Version is meant for MeeGo");
return QString();
}
......@@ -180,9 +180,9 @@ bool MaemoQtVersion::supportsShadowBuilds() const
return true;
}
QString MaemoQtVersion::osType() const
QString MaemoQtVersion::deviceType() const
{
return m_osType;
return m_deviceType;
}
Core::FeatureSet MaemoQtVersion::availableFeatures() const
......@@ -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 (osType() != QLatin1String(Maemo5OsType)) //Only Maemo5 has proper support for Widgets
if (deviceType() != QLatin1String(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 osType() const;
QString deviceType() const;
Core::FeatureSet availableFeatures() const;