From 35847fda82b42d269ed4fd7974e5c8332da3bc49 Mon Sep 17 00:00:00 2001 From: Pawel Polanski Date: Wed, 2 Mar 2011 12:04:31 +0100 Subject: [PATCH] Symbian: Added QtMObility to the device info --- .../qt-s60/s60deployconfigurationwidget.cpp | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp index 281167e876b..a86e12547ba 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp @@ -75,7 +75,8 @@ namespace Internal { const char STARTING_DRIVE_LETTER = 'C'; const char LAST_DRIVE_LETTER = 'Z'; -static const quint32 CODA_UID = 0x20021f96; +static const quint32 CODA_UID = 0x20021F96; +static const quint32 QTMOBILITY_UID = 0x2002AC89; QString formatDriveText(const S60DeployConfiguration::DeviceDrive &drive) { @@ -649,6 +650,7 @@ void S60DeployConfigurationWidget::updateDeviceInfo() QList packagesOfInterest; packagesOfInterest.append(CODA_UID); + packagesOfInterest.append(QTMOBILITY_UID); m_codaInfoDevice->sendSymbianInstallGetPackageInfoCommand(Coda::CodaCallback(this, &S60DeployConfigurationWidget::getInstalledPackagesResult), packagesOfInterest); } @@ -662,17 +664,35 @@ void S60DeployConfigurationWidget::updateDeviceInfo() QVariantList resultsList = result.values[0].toVariant().toList(); foreach (const QVariant& var, resultsList) { QVariantHash obj = var.toHash(); - if (obj.value("uid").toString().toUInt(0, 16) == CODA_UID) { - if (!obj.value("error").isNull()) { - // How can coda not be installed? Presumably some UID wrongness... - addErrorToTable(str, tr("CODA version: "), tr("Error reading CODA version")); - } else { - QVariantList version = obj.value("version").toList(); - addToTable(str, tr("CODA version:"), - QString("%1.%2.%3").arg(version[0].toInt()) - .arg(version[1].toInt()) - .arg(version[2].toInt())); - } + bool ok = false; + uint uid = obj.value("uid").toString().toUInt(&ok, 16); + if (ok) { + bool error = !obj.value("error").isNull(); + QString versionString; + if (!error) { + QVariantList version = obj.value("version").toList(); + versionString = QString("%1.%2.%3").arg(version[0].toInt()) + .arg(version[1].toInt()) + .arg(version[2].toInt()); + } + switch (uid) { + case CODA_UID: { + if (error) { + // How can coda not be installed? Presumably some UID wrongness... + addErrorToTable(str, tr("CODA version: "), tr("Error reading CODA version")); + } else + addToTable(str, tr("CODA version: "), versionString); + } + break; + case QTMOBILITY_UID: { + if (error) + addErrorToTable(str, tr("QtMobility version: "), tr("Error reading QtMobility version")); + else + addToTable(str, tr("QtMobility version: "), versionString); + } + break; + default: break; + } } } finishTable(resultString);