forked from qt-creator/qt-creator
S60: Move serialdevicelister.cpp to symbianutils/symbiandevicemanager.cpp
This commit is contained in:
@@ -10,7 +10,6 @@ SOURCES += $$PWD/s60devices.cpp \
|
||||
$$PWD/s60emulatorrunconfiguration.cpp \
|
||||
$$PWD/s60devicerunconfiguration.cpp \
|
||||
$$PWD/s60devicerunconfigurationwidget.cpp \
|
||||
$$PWD/serialdevicelister.cpp \
|
||||
$$PWD/rvcttoolchain.cpp \
|
||||
$$PWD/s60runconfigbluetoothstarter.cpp \
|
||||
$$PWD/abldparser.cpp \
|
||||
@@ -24,7 +23,6 @@ HEADERS += $$PWD/s60devices.h \
|
||||
$$PWD/s60emulatorrunconfiguration.h \
|
||||
$$PWD/s60devicerunconfiguration.h \
|
||||
$$PWD/s60devicerunconfigurationwidget.h \
|
||||
$$PWD/serialdevicelister.h \
|
||||
$$PWD/rvcttoolchain.h \
|
||||
$$PWD/s60runconfigbluetoothstarter.h \
|
||||
$$PWD/abldparser.h \
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "s60devices.h"
|
||||
#include "s60runconfigbluetoothstarter.h"
|
||||
#include "bluetoothlistener_gui.h"
|
||||
#include "serialdevicelister.h"
|
||||
#include "symbiandevicemanager.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -112,10 +112,10 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QSt
|
||||
m_cachedTargetInformationValid(false),
|
||||
#ifdef Q_OS_WIN
|
||||
m_serialPortName(QLatin1String("COM5")),
|
||||
m_communicationType(SerialPortCommunication),
|
||||
m_communicationType(SymbianUtils::SerialPortCommunication),
|
||||
#else
|
||||
m_serialPortName(QLatin1String(SymbianDeviceManager::linuxBlueToothDeviceRootC) + QLatin1Char('0')),
|
||||
m_communicationType(BlueToothCommunication),
|
||||
m_serialPortName(QLatin1String(SymbianUtils::SymbianDeviceManager::linuxBlueToothDeviceRootC) + QLatin1Char('0')),
|
||||
m_communicationType(SymbianUtils::BlueToothCommunication),
|
||||
#endif
|
||||
m_signingMode(SignSelf)
|
||||
{
|
||||
@@ -498,7 +498,7 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
|
||||
QTC_ASSERT(s60runConfig, return);
|
||||
m_toolChain = s60runConfig->toolChainType();
|
||||
m_serialPortName = s60runConfig->serialPortName();
|
||||
m_serialPortFriendlyName = SymbianDeviceManager::instance()->friendlyNameForPort(m_serialPortName);
|
||||
m_serialPortFriendlyName = SymbianUtils::SymbianDeviceManager::instance()->friendlyNameForPort(m_serialPortName);
|
||||
m_communicationType = s60runConfig->communicationType();
|
||||
m_targetName = s60runConfig->targetName();
|
||||
m_baseFileName = s60runConfig->basePackageFilePath();
|
||||
@@ -750,7 +750,7 @@ void S60DeviceRunControlBase::startDeployment()
|
||||
|
||||
//TODO sisx destination and file path user definable
|
||||
m_launcher->setTrkServerName(m_serialPortName);
|
||||
m_launcher->setSerialFrame(m_communicationType == SerialPortCommunication);
|
||||
m_launcher->setSerialFrame(m_communicationType == SymbianUtils::SerialPortCommunication);
|
||||
if (!m_commandLineArguments.isEmpty())
|
||||
m_launcher->setCommandLineArgs(m_commandLineArguments);
|
||||
const QString copySrc(m_baseFileName + ".sisx");
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "s60manager.h"
|
||||
#include "launcher.h"
|
||||
#include "bluetoothlistener.h"
|
||||
#include "serialdevicelister.h"
|
||||
#include "symbiandevicemanager.h"
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
Q_DECLARE_METATYPE(Qt4ProjectManager::Internal::SymbianDevice)
|
||||
Q_DECLARE_METATYPE(SymbianUtils::SymbianDevice)
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
@@ -100,7 +100,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
||||
formLayout->addRow(tr("Install File:"), m_sisxFileLabel);
|
||||
|
||||
updateSerialDevices();
|
||||
connect(SymbianDeviceManager::instance(), SIGNAL(updated()),
|
||||
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(updated()),
|
||||
this, SLOT(updateSerialDevices()));
|
||||
// Serial devices control
|
||||
connect(m_serialPortsCombo, SIGNAL(activated(int)), this, SLOT(setSerialPort(int)));
|
||||
@@ -180,10 +180,10 @@ void S60DeviceRunConfigurationWidget::updateSerialDevices()
|
||||
m_serialPortsCombo->clear();
|
||||
clearDeviceInfo();
|
||||
const QString previousRunConfigurationPortName = m_runConfiguration->serialPortName();
|
||||
const QList<SymbianDevice> devices = SymbianDeviceManager::instance()->devices();
|
||||
const QList<SymbianUtils::SymbianDevice> devices = SymbianUtils::SymbianDeviceManager::instance()->devices();
|
||||
int newIndex = -1;
|
||||
for (int i = 0; i < devices.size(); ++i) {
|
||||
const SymbianDevice &device = devices.at(i);
|
||||
const SymbianUtils::SymbianDevice &device = devices.at(i);
|
||||
m_serialPortsCombo->addItem(device.friendlyName(), qVariantFromValue(device));
|
||||
if (device.portName() == previousRunConfigurationPortName)
|
||||
newIndex = i;
|
||||
@@ -203,17 +203,17 @@ void S60DeviceRunConfigurationWidget::updateSerialDevices()
|
||||
}
|
||||
}
|
||||
|
||||
SymbianDevice S60DeviceRunConfigurationWidget::device(int i) const
|
||||
SymbianUtils::SymbianDevice S60DeviceRunConfigurationWidget::device(int i) const
|
||||
{
|
||||
if (i >= 0) {
|
||||
const QVariant data = m_serialPortsCombo->itemData(i);
|
||||
if (qVariantCanConvert<Qt4ProjectManager::Internal::SymbianDevice>(data))
|
||||
return qVariantValue<Qt4ProjectManager::Internal::SymbianDevice>(data);
|
||||
if (qVariantCanConvert<SymbianUtils::SymbianDevice>(data))
|
||||
return qVariantValue<SymbianUtils::SymbianDevice>(data);
|
||||
}
|
||||
return SymbianDevice();
|
||||
return SymbianUtils::SymbianDevice();
|
||||
}
|
||||
|
||||
SymbianDevice S60DeviceRunConfigurationWidget::currentDevice() const
|
||||
SymbianUtils::SymbianDevice S60DeviceRunConfigurationWidget::currentDevice() const
|
||||
{
|
||||
return device(m_serialPortsCombo->currentIndex());
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void S60DeviceRunConfigurationWidget::updateTargetInformation()
|
||||
|
||||
void S60DeviceRunConfigurationWidget::setSerialPort(int index)
|
||||
{
|
||||
const SymbianDevice d = device(index);
|
||||
const SymbianUtils::SymbianDevice d = device(index);
|
||||
m_runConfiguration->setSerialPortName(d.portName());
|
||||
m_runConfiguration->setCommunicationType(d.type());
|
||||
m_deviceInfoButton->setEnabled(index >= 0);
|
||||
@@ -323,8 +323,8 @@ void S60DeviceRunConfigurationWidget::updateDeviceInfo()
|
||||
// go asynchronous afterwards to pop up launch trk box if a timeout occurs.
|
||||
m_infoLauncher = new trk::Launcher(trk::Launcher::ActionPingOnly, QSharedPointer<trk::TrkDevice>(), this);
|
||||
connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int)));
|
||||
const SymbianDevice commDev = currentDevice();
|
||||
m_infoLauncher->setSerialFrame(commDev.type() == SerialPortCommunication);
|
||||
const SymbianUtils::SymbianDevice commDev = currentDevice();
|
||||
m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication);
|
||||
m_infoLauncher->setTrkServerName(commDev.portName());
|
||||
// Prompt user
|
||||
QString message;
|
||||
|
||||
@@ -49,10 +49,13 @@ namespace trk {
|
||||
class Launcher;
|
||||
}
|
||||
|
||||
namespace SymbianUtils {
|
||||
class SymbianDevice;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class SymbianDevice;
|
||||
class S60DeviceRunConfiguration;
|
||||
|
||||
/* Configuration widget for S60 devices on serial ports that are
|
||||
@@ -81,8 +84,8 @@ private slots:
|
||||
void slotWaitingForTrkClosed();
|
||||
|
||||
private:
|
||||
inline SymbianDevice device(int i) const;
|
||||
inline SymbianDevice currentDevice() const;
|
||||
inline SymbianUtils::SymbianDevice device(int i) const;
|
||||
inline SymbianUtils::SymbianDevice currentDevice() const;
|
||||
|
||||
void setDeviceInfoLabel(const QString &message, bool isError = false);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "s60manager.h"
|
||||
|
||||
#include "s60devicespreferencepane.h"
|
||||
#include "serialdevicelister.h"
|
||||
#include "symbiandevicemanager.h"
|
||||
#include "winscwtoolchain.h"
|
||||
#include "gccetoolchain.h"
|
||||
#include "rvcttoolchain.h"
|
||||
@@ -126,7 +126,7 @@ S60Manager::S60Manager(QObject *parent)
|
||||
connect(m_devices, SIGNAL(qtVersionsChanged()),
|
||||
this, SLOT(updateQtVersions()));
|
||||
connect(Core::ICore::instance()->mainWindow(), SIGNAL(deviceChange()),
|
||||
SymbianDeviceManager::instance(), SLOT(update()));
|
||||
SymbianUtils::SymbianDeviceManager::instance(), SLOT(update()));
|
||||
}
|
||||
|
||||
S60Manager::~S60Manager()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "s60runconfigbluetoothstarter.h"
|
||||
#include "bluetoothlistener.h"
|
||||
#include "serialdevicelister.h"
|
||||
#include "symbiandevicemanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
@@ -59,7 +59,7 @@ S60RunConfigBluetoothStarter::startCommunication(const TrkDevicePtr &trkDevice,
|
||||
QString *errorMessage)
|
||||
{
|
||||
// Bluetooth?
|
||||
if (communicationType == BlueToothCommunication) {
|
||||
if (communicationType == SymbianUtils::BlueToothCommunication) {
|
||||
S60RunConfigBluetoothStarter bluetoothStarter(trkDevice);
|
||||
bluetoothStarter.setDevice(device);
|
||||
return trk::promptStartBluetooth(bluetoothStarter, msgBoxParent, errorMessage);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "serialdevicelister.h"
|
||||
#include "symbiandevicemanager.h"
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QStringList>
|
||||
@@ -37,8 +37,7 @@
|
||||
#include <QtCore/QSharedData>
|
||||
#include <QtCore/QScopedPointer>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
namespace SymbianUtils {
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
@@ -317,5 +316,4 @@ QDebug operator<<(QDebug d, const SymbianDeviceManager &sdm)
|
||||
return d;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
} // namespace SymbianUtilsInternal
|
||||
@@ -27,8 +27,10 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SERIALDEVICELISTER_H
|
||||
#define SERIALDEVICELISTER_H
|
||||
#ifndef SYMBIANDEVICEMANAGER_H
|
||||
#define SYMBIANDEVICEMANAGER_H
|
||||
|
||||
#include "symbianutils_global.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QExplicitlySharedDataPointer>
|
||||
@@ -38,8 +40,7 @@ class QDebug;
|
||||
class QTextStream;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
namespace SymbianUtils {
|
||||
|
||||
struct SymbianDeviceManagerPrivate;
|
||||
class SymbianDeviceData;
|
||||
@@ -50,7 +51,7 @@ enum DeviceCommunicationType {
|
||||
};
|
||||
|
||||
// SymbianDevice, explicitly shared.
|
||||
class SymbianDevice {
|
||||
class SYMBIANUTILS_EXPORT SymbianDevice {
|
||||
explicit SymbianDevice(SymbianDeviceData *data);
|
||||
friend class SymbianDeviceManager;
|
||||
public:
|
||||
@@ -89,7 +90,7 @@ inline bool operator<(const SymbianDevice &d1, const SymbianDevice &d2)
|
||||
* and emits change signals.
|
||||
* On Windows, the update slot must be connected to a signal
|
||||
* emitted from an event handler listening for WM_DEVICECHANGE. */
|
||||
class SymbianDeviceManager : public QObject
|
||||
class SYMBIANUTILS_EXPORT SymbianDeviceManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -127,7 +128,6 @@ private:
|
||||
|
||||
QDebug operator<<(QDebug d, const SymbianDeviceManager &);
|
||||
|
||||
} // Internal
|
||||
} // Qt4ProjectManager
|
||||
} // namespace SymbianUtils
|
||||
|
||||
#endif // SERIALDEVICELISTER_H
|
||||
#endif // SYMBIANDEVICEMANAGER_H
|
||||
@@ -8,13 +8,15 @@ HEADERS += $$PWD/symbianutils_global.h \
|
||||
$$PWD/trkdevice.h \
|
||||
$$PWD/launcher.h \
|
||||
$$PWD/bluetoothlistener.h \
|
||||
$$PWD/communicationstarter.h
|
||||
$$PWD/communicationstarter.h \
|
||||
$$PWD/symbiandevicemanager.h
|
||||
|
||||
SOURCES += $$PWD/trkutils.cpp \
|
||||
$$PWD/trkdevice.cpp \
|
||||
$$PWD/launcher.cpp \
|
||||
$$PWD/bluetoothlistener.cpp \
|
||||
$$PWD/communicationstarter.cpp
|
||||
$$PWD/communicationstarter.cpp \
|
||||
$$PWD/symbiandevicemanager.cpp
|
||||
|
||||
# Tests/trklauncher is a console application
|
||||
contains(QT, gui) {
|
||||
|
||||
Reference in New Issue
Block a user