diff --git a/src/plugins/madde/maddedevice.h b/src/plugins/madde/maddedevice.h index 052471cb4b0..0a4f5953087 100644 --- a/src/plugins/madde/maddedevice.h +++ b/src/plugins/madde/maddedevice.h @@ -27,6 +27,7 @@ ** ** **************************************************************************/ + #ifndef MADDEDEVICE_H #define MADDEDEVICE_H diff --git a/src/plugins/madde/maemodeploymentmounter.cpp b/src/plugins/madde/maemodeploymentmounter.cpp index baa56eaed36..c7769e0a896 100644 --- a/src/plugins/madde/maemodeploymentmounter.cpp +++ b/src/plugins/madde/maemodeploymentmounter.cpp @@ -35,11 +35,11 @@ #include #include +#include #include #include using namespace ProjectExplorer; -using namespace RemoteLinux; using namespace QSsh; namespace Madde { diff --git a/src/plugins/madde/maemodeploymentmounter.h b/src/plugins/madde/maemodeploymentmounter.h index 7f94b5b1ae1..1c25b8e32a9 100644 --- a/src/plugins/madde/maemodeploymentmounter.h +++ b/src/plugins/madde/maemodeploymentmounter.h @@ -36,8 +36,6 @@ #include #include -#include - namespace ProjectExplorer { class Profile; } namespace QSsh { class SshConnection; } namespace Utils { class FileName; } @@ -49,6 +47,7 @@ class MaemoRemoteMounter; class MaemoDeploymentMounter : public QObject { Q_OBJECT + public: explicit MaemoDeploymentMounter(QObject *parent = 0); ~MaemoDeploymentMounter(); diff --git a/src/plugins/madde/maemoremotemounter.cpp b/src/plugins/madde/maemoremotemounter.cpp index 0e373e97892..8d04f4a310a 100644 --- a/src/plugins/madde/maemoremotemounter.cpp +++ b/src/plugins/madde/maemoremotemounter.cpp @@ -33,8 +33,9 @@ #include "maemoglobal.h" #include "maddedevice.h" +#include +#include #include -#include #include #include @@ -52,7 +53,7 @@ MaemoRemoteMounter::MaemoRemoteMounter(QObject *parent) m_utfsServerTimer(new QTimer(this)), m_mountProcess(new SshRemoteProcessRunner(this)), m_unmountProcess(new SshRemoteProcessRunner(this)), - m_portsGatherer(new RemoteLinuxUsedPortsGatherer(this)), + m_portsGatherer(new DeviceUsedPortsGatherer(this)), m_state(Inactive) { connect(m_utfsServerTimer, SIGNAL(timeout()), SLOT(handleUtfsServerTimeout())); diff --git a/src/plugins/madde/maemoremotemounter.h b/src/plugins/madde/maemoremotemounter.h index bd09f5457a6..dcd2e39eb33 100644 --- a/src/plugins/madde/maemoremotemounter.h +++ b/src/plugins/madde/maemoremotemounter.h @@ -45,8 +45,7 @@ QT_FORWARD_DECLARE_CLASS(QTimer) namespace QSsh { class SshRemoteProcessRunner; } - -namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; } +namespace ProjectExplorer { class DeviceUsedPortsGatherer; } namespace Madde { namespace Internal { @@ -54,6 +53,7 @@ namespace Internal { class MaemoRemoteMounter : public QObject { Q_OBJECT + public: MaemoRemoteMounter(QObject *parent = 0); ~MaemoRemoteMounter(); @@ -120,7 +120,7 @@ private: typedef QSharedPointer ProcPtr; QList m_utfsServers; - RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer; + ProjectExplorer::DeviceUsedPortsGatherer *m_portsGatherer; Utils::FileName m_maddeRoot; State m_state; diff --git a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp similarity index 83% rename from src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp rename to src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index 557cb3909c4..4c02ce26417 100644 --- a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -27,7 +27,7 @@ ** **************************************************************************/ -#include "remotelinuxusedportsgatherer.h" +#include "deviceusedportsgatherer.h" #include #include @@ -35,16 +35,13 @@ #include #include -#include - -using namespace ProjectExplorer; using namespace QSsh; using namespace Utils; -namespace RemoteLinux { +namespace ProjectExplorer { namespace Internal { -class RemoteLinuxUsedPortsGathererPrivate +class DeviceUsedPortsGathererPrivate { public: SshConnection *connection; @@ -58,21 +55,19 @@ class RemoteLinuxUsedPortsGathererPrivate } // namespace Internal -using namespace Internal; - -RemoteLinuxUsedPortsGatherer::RemoteLinuxUsedPortsGatherer(QObject *parent) : - QObject(parent), d(new RemoteLinuxUsedPortsGathererPrivate) +DeviceUsedPortsGatherer::DeviceUsedPortsGatherer(QObject *parent) : + QObject(parent), d(new Internal::DeviceUsedPortsGathererPrivate) { d->connection = 0; } -RemoteLinuxUsedPortsGatherer::~RemoteLinuxUsedPortsGatherer() +DeviceUsedPortsGatherer::~DeviceUsedPortsGatherer() { stop(); delete d; } -void RemoteLinuxUsedPortsGatherer::start(const IDevice::ConstPtr &devConf) +void DeviceUsedPortsGatherer::start(const IDevice::ConstPtr &devConf) { QTC_ASSERT(!d->connection, return); d->portsToCheck = devConf->freePorts(); @@ -87,7 +82,7 @@ void RemoteLinuxUsedPortsGatherer::start(const IDevice::ConstPtr &devConf) d->connection->connectToHost(); } -void RemoteLinuxUsedPortsGatherer::handleConnectionEstablished() +void DeviceUsedPortsGatherer::handleConnectionEstablished() { QString command = d->command; if (command.isEmpty()) { @@ -113,7 +108,7 @@ void RemoteLinuxUsedPortsGatherer::handleConnectionEstablished() d->process->start(); } -void RemoteLinuxUsedPortsGatherer::stop() +void DeviceUsedPortsGatherer::stop() { if (!d->connection) return; @@ -128,7 +123,7 @@ void RemoteLinuxUsedPortsGatherer::stop() d->connection = 0; } -int RemoteLinuxUsedPortsGatherer::getNextFreePort(PortList *freePorts) const +int DeviceUsedPortsGatherer::getNextFreePort(PortList *freePorts) const { while (freePorts->hasMore()) { const int port = freePorts->getNext(); @@ -138,17 +133,17 @@ int RemoteLinuxUsedPortsGatherer::getNextFreePort(PortList *freePorts) const return -1; } -QList RemoteLinuxUsedPortsGatherer::usedPorts() const +QList DeviceUsedPortsGatherer::usedPorts() const { return d->usedPorts; } -void RemoteLinuxUsedPortsGatherer::setCommand(const QString &command) +void DeviceUsedPortsGatherer::setCommand(const QString &command) { d->command = command; } -void RemoteLinuxUsedPortsGatherer::setupUsedPorts() +void DeviceUsedPortsGatherer::setupUsedPorts() { QList portStrings = d->remoteStdout.split('\n'); portStrings.removeFirst(); @@ -168,7 +163,7 @@ void RemoteLinuxUsedPortsGatherer::setupUsedPorts() emit portListReady(); } -void RemoteLinuxUsedPortsGatherer::handleConnectionError() +void DeviceUsedPortsGatherer::handleConnectionError() { if (!d->connection) return; @@ -176,7 +171,7 @@ void RemoteLinuxUsedPortsGatherer::handleConnectionError() stop(); } -void RemoteLinuxUsedPortsGatherer::handleProcessClosed(int exitStatus) +void DeviceUsedPortsGatherer::handleProcessClosed(int exitStatus) { if (!d->connection) return; @@ -208,16 +203,16 @@ void RemoteLinuxUsedPortsGatherer::handleProcessClosed(int exitStatus) stop(); } -void RemoteLinuxUsedPortsGatherer::handleRemoteStdOut() +void DeviceUsedPortsGatherer::handleRemoteStdOut() { if (d->process) d->remoteStdout += d->process->readAllStandardOutput(); } -void RemoteLinuxUsedPortsGatherer::handleRemoteStdErr() +void DeviceUsedPortsGatherer::handleRemoteStdErr() { if (d->process) d->remoteStderr += d->process->readAllStandardError(); } -} // namespace RemoteLinux +} // namespace ProjectExplorer diff --git a/src/plugins/remotelinux/remotelinuxusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h similarity index 71% rename from src/plugins/remotelinux/remotelinuxusedportsgatherer.h rename to src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h index a19e3143755..0d4cb244f11 100644 --- a/src/plugins/remotelinux/remotelinuxusedportsgatherer.h +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h @@ -26,34 +26,25 @@ ** ** **************************************************************************/ -#ifndef REMOTELINUXUSEDPORTSGATHERER_H -#define REMOTELINUXUSEDPORTSGATHERER_H -#include "remotelinux_export.h" +#ifndef DEVICEUSEDPORTSGATHERER_H +#define DEVICEUSEDPORTSGATHERER_H -#include - -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QString) +#include "idevice.h" namespace Utils { class PortList; } -namespace RemoteLinux { +namespace ProjectExplorer { +namespace Internal { class DeviceUsedPortsGathererPrivate; } -namespace Internal { -class RemoteLinuxUsedPortsGathererPrivate; -} // namespace Internal - -class REMOTELINUX_EXPORT RemoteLinuxUsedPortsGatherer : public QObject +class PROJECTEXPLORER_EXPORT DeviceUsedPortsGatherer : public QObject { Q_OBJECT - Q_DISABLE_COPY(RemoteLinuxUsedPortsGatherer) + public: - explicit RemoteLinuxUsedPortsGatherer(QObject *parent = 0); - ~RemoteLinuxUsedPortsGatherer(); + explicit DeviceUsedPortsGatherer(QObject *parent = 0); + ~DeviceUsedPortsGatherer(); + void start(const ProjectExplorer::IDevice::ConstPtr &devConf); void stop(); int getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left @@ -75,9 +66,9 @@ private slots: private: void setupUsedPorts(); - Internal::RemoteLinuxUsedPortsGathererPrivate * const d; + Internal::DeviceUsedPortsGathererPrivate * const d; }; -} // namespace RemoteLinux +} // namespace ProjectExplorer -#endif // REMOTELINUXUSEDPORTSGATHERER_H +#endif // DEVICEUSEDPORTSGATHERER_H diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index f457e81898a..cd8a533557f 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -124,7 +124,8 @@ HEADERS += projectexplorer.h \ devicesupport/deviceprocesslist.h \ devicesupport/deviceprocessesdialog.h \ devicesupport/devicesettingswidget.h \ - devicesupport/devicesettingspage.h + devicesupport/devicesettingspage.h \ + devicesupport/deviceusedportsgatherer.h SOURCES += projectexplorer.cpp \ abi.cpp \ @@ -225,7 +226,8 @@ SOURCES += projectexplorer.cpp \ devicesupport/deviceprocesslist.cpp \ devicesupport/deviceprocessesdialog.cpp \ devicesupport/devicesettingswidget.cpp \ - devicesupport/devicesettingspage.cpp + devicesupport/devicesettingspage.cpp \ + devicesupport/deviceusedportsgatherer.cpp FORMS += processstep.ui \ editorsettingspropertiespage.ui \ diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 067cddb55d0..0e5dbeeae56 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -304,6 +304,8 @@ QtcPlugin { "devicesupport/devicesettingswidget.cpp", "devicesupport/devicesettingswidget.h", "devicesupport/devicesettingswidget.ui", + "devicesupport/deviceusedportsgatherer.cpp", + "devicesupport/deviceusedportsgatherer.h", "devicesupport/idevicewidget.h", "devicesupport/idevicefactory.cpp", "devicesupport/idevicefactory.h" diff --git a/src/plugins/qnx/qnxapplicationrunner.cpp b/src/plugins/qnx/qnxapplicationrunner.cpp index 56cbf879b29..2156f059aac 100644 --- a/src/plugins/qnx/qnxapplicationrunner.cpp +++ b/src/plugins/qnx/qnxapplicationrunner.cpp @@ -35,8 +35,6 @@ #include "qnxrunconfiguration.h" #include "qnxconstants.h" -#include - using namespace Qnx; using namespace Qnx::Internal; diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index d297c95346c..039d5f7cd5c 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -36,7 +36,6 @@ #include "qnxconstants.h" #include -#include #include using namespace Qnx; diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp index 741f6476531..6b736407ac1 100644 --- a/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp +++ b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp @@ -37,11 +37,11 @@ #include "qnxdeviceconfigurationwizardpages.h" #include "qnxdeviceconfiguration.h" +#include #include #include #include #include -#include #include using namespace ProjectExplorer; diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.h b/src/plugins/remotelinux/linuxdeviceconfiguration.h index bfb82f7cb7b..8ce10b8cbef 100644 --- a/src/plugins/remotelinux/linuxdeviceconfiguration.h +++ b/src/plugins/remotelinux/linuxdeviceconfiguration.h @@ -40,13 +40,12 @@ namespace QSsh { class SshConnectionParameters; } namespace Utils { class PortList; } namespace RemoteLinux { -namespace Internal { -class LinuxDeviceConfigurationPrivate; -} // namespace Internal +namespace Internal { class LinuxDeviceConfigurationPrivate; } class REMOTELINUX_EXPORT LinuxDeviceConfiguration : public ProjectExplorer::IDevice { Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::LinuxDeviceConfiguration) + public: typedef QSharedPointer Ptr; typedef QSharedPointer ConstPtr; diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 8dea034a659..292ba2b4a13 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -27,10 +27,10 @@ ** ** **************************************************************************/ + #include "linuxdevicetester.h" -#include "remotelinuxusedportsgatherer.h" - +#include #include #include #include @@ -54,7 +54,7 @@ public: IDevice::ConstPtr deviceConfiguration; SshConnection *connection; SshRemoteProcess::Ptr process; - RemoteLinuxUsedPortsGatherer portsGatherer; + DeviceUsedPortsGatherer portsGatherer; State state; }; @@ -113,7 +113,7 @@ void GenericLinuxDeviceTester::stopTest() setFinished(TestFailure); } -RemoteLinuxUsedPortsGatherer *GenericLinuxDeviceTester::usedPortsGatherer() const +DeviceUsedPortsGatherer *GenericLinuxDeviceTester::usedPortsGatherer() const { return &d->portsGatherer; } diff --git a/src/plugins/remotelinux/linuxdevicetester.h b/src/plugins/remotelinux/linuxdevicetester.h index b7a9b1fc2c6..d4b1467596a 100644 --- a/src/plugins/remotelinux/linuxdevicetester.h +++ b/src/plugins/remotelinux/linuxdevicetester.h @@ -35,16 +35,12 @@ #include -namespace QSsh { -class SshConnection; -} +namespace ProjectExplorer { class DeviceUsedPortsGatherer; } +namespace QSsh { class SshConnection; } namespace RemoteLinux { -class RemoteLinuxUsedPortsGatherer; -namespace Internal { -class GenericLinuxDeviceTesterPrivate; -} +namespace Internal { class GenericLinuxDeviceTesterPrivate; } class REMOTELINUX_EXPORT AbstractLinuxDeviceTester : public QObject { @@ -77,7 +73,7 @@ public: void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration); void stopTest(); - RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const; + ProjectExplorer::DeviceUsedPortsGatherer *usedPortsGatherer() const; private slots: void handleConnected(); diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro index dcf4120f788..263d3ae0fdd 100644 --- a/src/plugins/remotelinux/remotelinux.pro +++ b/src/plugins/remotelinux/remotelinux.pro @@ -44,7 +44,6 @@ HEADERS += \ remotelinuxenvironmentreader.h \ sshkeydeployer.h \ typespecificdeviceconfigurationlistmodel.h \ - remotelinuxusedportsgatherer.h \ remotelinuxutils.h \ deploymentsettingsassistant.h \ remotelinuxdeployconfigurationwidget.h \ @@ -92,7 +91,6 @@ SOURCES += \ remotelinuxenvironmentreader.cpp \ sshkeydeployer.cpp \ typespecificdeviceconfigurationlistmodel.cpp \ - remotelinuxusedportsgatherer.cpp \ remotelinuxutils.cpp \ deploymentsettingsassistant.cpp \ remotelinuxdeployconfigurationwidget.cpp \ diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 86001e55329..1b0afe7d225 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -87,7 +87,6 @@ QtcPlugin { "remotelinuxrunconfigurationwidget.cpp", "remotelinuxrunconfigurationwidget.h", "remotelinuxruncontrol.h", - "remotelinuxusedportsgatherer.cpp", "remotelinuxutils.cpp", "remotelinuxutils.h", "startgdbserverdialog.cpp", @@ -105,7 +104,6 @@ QtcPlugin { "remotelinuxenvironmentreader.cpp", "remotelinuxenvironmentreader.h", "remotelinuxpackageinstaller.h", - "remotelinuxusedportsgatherer.h", "sshkeydeployer.cpp", "sshkeydeployer.h", "typespecificdeviceconfigurationlistmodel.cpp", diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp index b05f9bf8d8a..1d73d77cf56 100644 --- a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp +++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp @@ -31,10 +31,10 @@ #include "linuxdeviceconfiguration.h" #include "remotelinuxrunconfiguration.h" -#include "remotelinuxusedportsgatherer.h" #include #include +#include #include #include @@ -74,7 +74,7 @@ public: state(Inactive) { } - RemoteLinuxUsedPortsGatherer portsGatherer; + DeviceUsedPortsGatherer portsGatherer; IDevice::ConstPtr devConfig; const QString remoteExecutable; const QString appArguments; @@ -119,7 +119,7 @@ IDevice::ConstPtr AbstractRemoteLinuxApplicationRunner::devConfig() const return d->devConfig; } -RemoteLinuxUsedPortsGatherer *AbstractRemoteLinuxApplicationRunner::usedPortsGatherer() const +DeviceUsedPortsGatherer *AbstractRemoteLinuxApplicationRunner::usedPortsGatherer() const { return &d->portsGatherer; } diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.h b/src/plugins/remotelinux/remotelinuxapplicationrunner.h index a9e8e6c951e..1b0d850bca5 100644 --- a/src/plugins/remotelinux/remotelinuxapplicationrunner.h +++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.h @@ -26,26 +26,22 @@ ** ** **************************************************************************/ + #ifndef REMOTELINUXAPPLICATIONRUNNER_H #define REMOTELINUXAPPLICATIONRUNNER_H #include "remotelinux_export.h" #include - -#include -#include +#include namespace QSsh { class SshConnection; } namespace Utils { class PortList; } namespace RemoteLinux { class RemoteLinuxRunConfiguration; -class RemoteLinuxUsedPortsGatherer; -namespace Internal { -class AbstractRemoteLinuxApplicationRunnerPrivate; -} +namespace Internal { class AbstractRemoteLinuxApplicationRunnerPrivate; } class REMOTELINUX_EXPORT AbstractRemoteLinuxApplicationRunner : public QObject { @@ -63,7 +59,7 @@ public: ProjectExplorer::IDevice::ConstPtr devConfig() const; QSsh::SshConnection *connection() const; - RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const; + ProjectExplorer::DeviceUsedPortsGatherer *usedPortsGatherer() const; Utils::PortList *freePorts(); QString remoteExecutable() const; QString arguments() const; diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 9920a413b6a..30dd23fe660 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -31,13 +31,13 @@ #include "remotelinuxapplicationrunner.h" #include "remotelinuxrunconfiguration.h" -#include "remotelinuxusedportsgatherer.h" #include #include #include #include #include +#include #include #include #include diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp index 63d08b40567..5a1ccb3090d 100644 --- a/src/plugins/remotelinux/startgdbserverdialog.cpp +++ b/src/plugins/remotelinux/startgdbserverdialog.cpp @@ -30,13 +30,13 @@ #include "startgdbserverdialog.h" -#include "remotelinuxusedportsgatherer.h" - #include #include #include #include #include +#include + #include #include #include @@ -101,7 +101,7 @@ public: QPushButton *closeButton; ProfileChooser *profileChooser; - RemoteLinuxUsedPortsGatherer gatherer; + DeviceUsedPortsGatherer gatherer; SshRemoteProcessRunner runner; QSettings *settings; QString remoteCommandLine;