Commit 3e62b80b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qnx: Compile fix



Change-Id: I77e6182a6b908857d7bc382582915b88cc2e78e2
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 84a28d1e
...@@ -80,8 +80,8 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar ...@@ -80,8 +80,8 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar
m_ui->debugToken->setInitialBrowsePathBackup(debugTokenBrowsePath); m_ui->debugToken->setInitialBrowsePathBackup(debugTokenBrowsePath);
connect(m_ui->deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onDeviceSelectionChanged())); connect(m_ui->deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onDeviceSelectionChanged()));
connect(m_deviceListDetector, SIGNAL(deviceDetected(QString,QString,BlackBerryDeviceListDetector::DeviceType)), connect(m_deviceListDetector, SIGNAL(deviceDetected(QString,QString,bool)),
this, SLOT(onDeviceDetected(QString,QString,BlackBerryDeviceListDetector::DeviceType))); this, SLOT(onDeviceDetected(QString,QString,bool)));
connect(m_deviceListDetector, SIGNAL(finished()), this, SLOT(onDeviceListDetectorFinished())); connect(m_deviceListDetector, SIGNAL(finished()), this, SLOT(onDeviceListDetectorFinished()));
connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
...@@ -136,8 +136,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceListDetectorFinished( ...@@ -136,8 +136,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceListDetectorFinished(
} }
void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected( void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected(
const QString &deviceName, const QString &hostName, const QString &deviceName, const QString &hostName, bool isSimulator)
const BlackBerryDeviceListDetector::DeviceType deviceType)
{ {
QString displayName(deviceName); QString displayName(deviceName);
if (displayName != hostName) if (displayName != hostName)
...@@ -146,7 +145,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected( ...@@ -146,7 +145,7 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceDetected(
QListWidgetItem *device = createDeviceListItem(displayName, Autodetected); QListWidgetItem *device = createDeviceListItem(displayName, Autodetected);
device->setData(DeviceNameRole, displayName); device->setData(DeviceNameRole, displayName);
device->setData(DeviceIpRole, hostName); device->setData(DeviceIpRole, hostName);
device->setData(DeviceTypeRole, QVariant::fromValue(deviceType)); device->setData(DeviceTypeRole, isSimulator);
QListWidgetItem *pleaseWait = findDeviceListItem(PleaseWait); QListWidgetItem *pleaseWait = findDeviceListItem(PleaseWait);
int row = pleaseWait ? m_ui->deviceListWidget->row(pleaseWait) : m_ui->deviceListWidget->count(); int row = pleaseWait ? m_ui->deviceListWidget->row(pleaseWait) : m_ui->deviceListWidget->count();
m_ui->deviceListWidget->insertItem(row, device); m_ui->deviceListWidget->insertItem(row, device);
...@@ -157,9 +156,8 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged() ...@@ -157,9 +156,8 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged()
QList<QListWidgetItem *> selectedItems = m_ui->deviceListWidget->selectedItems(); QList<QListWidgetItem *> selectedItems = m_ui->deviceListWidget->selectedItems();
const QListWidgetItem *selected = selectedItems.count() == 1 ? selectedItems[0] : 0; const QListWidgetItem *selected = selectedItems.count() == 1 ? selectedItems[0] : 0;
const ItemKind itemKind = selected ? selected->data(ItemKindRole).value<ItemKind>() : Note; const ItemKind itemKind = selected ? selected->data(ItemKindRole).value<ItemKind>() : Note;
const BlackBerryDeviceListDetector::DeviceType deviceType = selected && itemKind == Autodetected const bool isSimulator = selected && itemKind == Autodetected
? selected->data(DeviceTypeRole).value<BlackBerryDeviceListDetector::DeviceType>() ? selected->data(DeviceTypeRole).toBool() : false;
: BlackBerryDeviceListDetector::Device;
switch (itemKind) { switch (itemKind) {
case SpecifyManually: case SpecifyManually:
m_ui->deviceName->setEnabled(true); m_ui->deviceName->setEnabled(true);
...@@ -179,9 +177,9 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged() ...@@ -179,9 +177,9 @@ void BlackBerryDeviceConfigurationWizardSetupPage::onDeviceSelectionChanged()
m_ui->deviceHostIp->setEnabled(false); m_ui->deviceHostIp->setEnabled(false);
m_ui->deviceHostIp->setText(selected->data(DeviceIpRole).toString()); m_ui->deviceHostIp->setText(selected->data(DeviceIpRole).toString());
m_ui->physicalDevice->setEnabled(false); 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->setEnabled(false);
m_ui->simulator->setChecked(deviceType == BlackBerryDeviceListDetector::Simulator); m_ui->simulator->setChecked(isSimulator);
m_ui->password->setFocus(); m_ui->password->setFocus();
break; break;
case PleaseWait: case PleaseWait:
......
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
private slots: private slots:
void requestDebugToken(); void requestDebugToken();
void onDeviceSelectionChanged(); 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(); void onDeviceListDetectorFinished();
private: private:
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "blackberrydevicelistdetector.h" #include "blackberrydevicelistdetector.h"
#include "blackberryndkprocess.h"
#include <QStringList> #include <QStringList>
namespace Qnx { namespace Qnx {
...@@ -84,7 +86,7 @@ void BlackBerryDeviceListDetector::processData(const QString &line) ...@@ -84,7 +86,7 @@ void BlackBerryDeviceListDetector::processData(const QString &line)
// line format is: deviceName,deviceHostName,deviceType,deviceDisplayName // line format is: deviceName,deviceHostName,deviceType,deviceDisplayName
QStringList list = line.split(QLatin1String(",")); QStringList list = line.split(QLatin1String(","));
if (list.count() == 4) { 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]);
} }
} }
......
...@@ -31,32 +31,25 @@ ...@@ -31,32 +31,25 @@
#ifndef QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #ifndef QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H
#define QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #define QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H
#include "blackberryndkprocess.h"
#include <QObject> #include <QObject>
#include <QString> #include <QString>
namespace Qnx { QT_FORWARD_DECLARE_CLASS(QProcess)
namespace Qnx {
namespace Internal { namespace Internal {
class BlackBerryDeviceListDetector : public QObject class BlackBerryDeviceListDetector : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
enum DeviceType {
Device,
Simulator
};
explicit BlackBerryDeviceListDetector(QObject *parent = 0); explicit BlackBerryDeviceListDetector(QObject *parent = 0);
void detectDeviceList(); void detectDeviceList();
signals: signals:
void deviceDetected( void deviceDetected(const QString &deviceName, const QString &deviceHostName,
const QString &deviceName, const QString &deviceHostName, bool isSimulator);
const BlackBerryDeviceListDetector::DeviceType deviceType);
void finished(); void finished();
private slots: private slots:
...@@ -73,6 +66,4 @@ private: ...@@ -73,6 +66,4 @@ private:
} // namespace Internal } // namespace Internal
} // namespace Qnx } // namespace Qnx
Q_DECLARE_METATYPE(Qnx::Internal::BlackBerryDeviceListDetector::DeviceType)
#endif // QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H #endif // QNX_INTERNAL_BLACKBERRYDEVICELISTDETECTOR_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment