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

Qnx: Compile fix

Change-Id: I77e6182a6b908857d7bc382582915b88cc2e78e2
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 84a28d1e
......@@ -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:
......
......@@ -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:
......
......@@ -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]);
}
}
......
......@@ -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
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