From 3e62b80bf9146e298516a0a64a1c74fece482d10 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@digia.com> Date: Thu, 8 Aug 2013 18:31:44 +0200 Subject: [PATCH] Qnx: Compile fix Change-Id: I77e6182a6b908857d7bc382582915b88cc2e78e2 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> --- ...lackberrydeviceconfigurationwizardpages.cpp | 18 ++++++++---------- .../blackberrydeviceconfigurationwizardpages.h | 2 +- .../qnx/blackberrydevicelistdetector.cpp | 4 +++- src/plugins/qnx/blackberrydevicelistdetector.h | 17 ++++------------- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp index 801400b3f34..6685bf5c650 100644 --- a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp +++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp @@ -80,8 +80,8 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar m_ui->debugToken->setInitialBrowsePathBackup(debugTokenBrowsePath); connect(m_ui->deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onDeviceSelectionChanged())); - connect(m_deviceListDetector, SIGNAL(deviceDetected(QString,QString,BlackBerryDeviceListDetector::DeviceType)), - this, SLOT(onDeviceDetected(QString,QString,BlackBerryDeviceListDetector::DeviceType))); + connect(m_deviceListDetector, SIGNAL(deviceDetected(QString,QString,bool)), + this, SLOT(onDeviceDetected(QString,QString,bool))); connect(m_deviceListDetector, SIGNAL(finished()), this, SLOT(onDeviceListDetectorFinished())); connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); @@ -136,8 +136,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceListDetectorFinished( } void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected( - const QString &deviceName, const QString &hostName, - const BlackBerryDeviceListDetector::DeviceType deviceType) + const QString &deviceName, const QString &hostName, bool isSimulator) { QString displayName(deviceName); if (displayName != hostName) @@ -146,7 +145,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected( QListWidgetItem *device = createDeviceListItem(displayName, Autodetected); device->setData(DeviceNameRole, displayName); device->setData(DeviceIpRole, hostName); - device->setData(DeviceTypeRole, QVariant::fromValue(deviceType)); + device->setData(DeviceTypeRole, isSimulator); QListWidgetItem *pleaseWait = findDeviceListItem(PleaseWait); int row = pleaseWait ? m_ui->deviceListWidget->row(pleaseWait) : m_ui->deviceListWidget->count(); m_ui->deviceListWidget->insertItem(row, device); @@ -157,9 +156,8 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged() QList<QListWidgetItem *> selectedItems = m_ui->deviceListWidget->selectedItems(); const QListWidgetItem *selected = selectedItems.count() == 1 ? selectedItems[0] : 0; const ItemKind itemKind = selected ? selected->data(ItemKindRole).value<ItemKind>() : Note; - const BlackBerryDeviceListDetector::DeviceType deviceType = selected && itemKind == Autodetected - ? selected->data(DeviceTypeRole).value<BlackBerryDeviceListDetector::DeviceType>() - : BlackBerryDeviceListDetector::Device; + const bool isSimulator = selected && itemKind == Autodetected + ? selected->data(DeviceTypeRole).toBool() : false; switch (itemKind) { case SpecifyManually: m_ui->deviceName->setEnabled(true); @@ -179,9 +177,9 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged() m_ui->deviceHostIp->setEnabled(false); m_ui->deviceHostIp->setText(selected->data(DeviceIpRole).toString()); m_ui->physicalDevice->setEnabled(false); - m_ui->physicalDevice->setChecked(deviceType == BlackBerryDeviceListDetector::Device); + m_ui->physicalDevice->setChecked(!isSimulator); m_ui->simulator->setEnabled(false); - m_ui->simulator->setChecked(deviceType == BlackBerryDeviceListDetector::Simulator); + m_ui->simulator->setChecked(isSimulator); m_ui->password->setFocus(); break; case PleaseWait: diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h index 6cf7467f1e9..e2310331b9d 100644 --- a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h +++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h @@ -73,7 +73,7 @@ public: private slots: void requestDebugToken(); void onDeviceSelectionChanged(); - void onDeviceDetected(const QString &deviceName, const QString &hostName, const BlackBerryDeviceListDetector::DeviceType deviceType); + void onDeviceDetected(const QString &deviceName, const QString &hostName, bool isSimulator); void onDeviceListDetectorFinished(); private: diff --git a/src/plugins/qnx/blackberrydevicelistdetector.cpp b/src/plugins/qnx/blackberrydevicelistdetector.cpp index 5f69d292767..93a2fc7b709 100644 --- a/src/plugins/qnx/blackberrydevicelistdetector.cpp +++ b/src/plugins/qnx/blackberrydevicelistdetector.cpp @@ -30,6 +30,8 @@ #include "blackberrydevicelistdetector.h" +#include "blackberryndkprocess.h" + #include <QStringList> namespace Qnx { @@ -84,7 +86,7 @@ void BlackBerryDeviceListDetector::processData(const QString &line) // line format is: deviceName,deviceHostName,deviceType,deviceDisplayName QStringList list = line.split(QLatin1String(",")); if (list.count() == 4) { - emit deviceDetected (list[3].isEmpty() ? list[0] : list[3], list[1], QLatin1String("Simulator") == list[2] ? Simulator : Device); + emit deviceDetected (list[3].isEmpty() ? list[0] : list[3], list[1], QLatin1String("Simulator") == list[2]); } } diff --git a/src/plugins/qnx/blackberrydevicelistdetector.h b/src/plugins/qnx/blackberrydevicelistdetector.h index 97e091abaf1..a4445db3649 100644 --- a/src/plugins/qnx/blackberrydevicelistdetector.h +++ b/src/plugins/qnx/blackberrydevicelistdetector.h @@ -31,32 +31,25 @@ #ifndef QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #define QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H -#include "blackberryndkprocess.h" - #include <QObject> #include <QString> -namespace Qnx { +QT_FORWARD_DECLARE_CLASS(QProcess) +namespace Qnx { namespace Internal { class BlackBerryDeviceListDetector : public QObject { Q_OBJECT public: - enum DeviceType { - Device, - Simulator - }; - explicit BlackBerryDeviceListDetector(QObject *parent = 0); void detectDeviceList(); signals: - void deviceDetected( - const QString &deviceName, const QString &deviceHostName, - const BlackBerryDeviceListDetector::DeviceType deviceType); + void deviceDetected(const QString &deviceName, const QString &deviceHostName, + bool isSimulator); void finished(); private slots: @@ -73,6 +66,4 @@ private: } // namespace Internal } // namespace Qnx -Q_DECLARE_METATYPE(Qnx::Internal::BlackBerryDeviceListDetector::DeviceType) - #endif // QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H -- GitLab