diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2011-06-22 10:00:50 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2011-06-22 10:34:39 +0200 |
commit | 9197596000763f1d6eed9c2a25b1605a6fbf8347 (patch) | |
tree | ff815de49a329e23f1966ac67613a1b493298b45 /src/plugins/remotelinux/linuxdeviceconfiguration.h | |
parent | b86872e7fdac1dc5d7d32eb54d152a1e9b155ddf (diff) | |
download | qt-creator-9197596000763f1d6eed9c2a25b1605a6fbf8347.tar.gz |
RemoteLinux: Put PortList class into its own set of files.
This also enables us to replace some includes by forward declarations.
Change-Id: Ica98c1925e49c65d15b9e47abe1c4aeba0790482
Reviewed-on: http://codereview.qt.nokia.com/583
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Diffstat (limited to 'src/plugins/remotelinux/linuxdeviceconfiguration.h')
-rw-r--r-- | src/plugins/remotelinux/linuxdeviceconfiguration.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.h b/src/plugins/remotelinux/linuxdeviceconfiguration.h index 5f35947b18..a03b0f15b6 100644 --- a/src/plugins/remotelinux/linuxdeviceconfiguration.h +++ b/src/plugins/remotelinux/linuxdeviceconfiguration.h @@ -32,11 +32,11 @@ #ifndef LINUXDEVICECONFIGURATION_H #define LINUXDEVICECONFIGURATION_H +#include "portlist.h" #include "remotelinux_export.h" #include <utils/ssh/sshconnection.h> -#include <QtCore/QPair> #include <QtCore/QSharedPointer> #include <QtCore/QString> #include <QtCore/QStringList> @@ -53,24 +53,6 @@ namespace Internal { class LinuxDeviceConfigurations; } -class REMOTELINUX_EXPORT PortList -{ -public: - void addPort(int port); - void addRange(int startPort, int endPort); - bool hasMore() const; - int count() const; - int getNext(); - QString toString() const; - - static QString regularExpression(); - -private: - typedef QPair<int, int> Range; - QList<Range> m_ranges; -}; - - class REMOTELINUX_EXPORT LinuxDeviceConfiguration { friend class Internal::LinuxDeviceConfigurations; @@ -87,13 +69,14 @@ public: enum DeviceType { Physical, Emulator }; - PortList freePorts() const; + ~LinuxDeviceConfiguration(); + + PortList freePorts() const { return m_freePorts; } Utils::SshConnectionParameters sshParameters() const { return m_sshParameters; } QString name() const { return m_name; } void setName(const QString &name) { m_name = name; } QString osType() const { return m_osType; } DeviceType type() const { return m_type; } - QString portsSpec() const { return m_portsSpec; } Id internalId() const { return m_internalId; } bool isDefault() const { return m_isDefault; } @@ -103,10 +86,10 @@ public: static const Id InvalidId; static Ptr create(const QString &name, const QString &osType, DeviceType deviceType, - const QString &freePortsSpec, const Utils::SshConnectionParameters &sshParams); + const PortList &freePorts, const Utils::SshConnectionParameters &sshParams); private: LinuxDeviceConfiguration(const QString &name, const QString &osType, DeviceType deviceType, - const QString &freePortsSpec, const Utils::SshConnectionParameters &sshParams); + const PortList &freePorts, const Utils::SshConnectionParameters &sshParams); LinuxDeviceConfiguration(const QSettings &settings, Id &nextId); LinuxDeviceConfiguration(const ConstPtr &other); @@ -118,13 +101,12 @@ private: static Ptr create(const ConstPtr &other); void save(QSettings &settings) const; - QString defaultPortsSpec(DeviceType type) const; Utils::SshConnectionParameters m_sshParameters; QString m_name; QString m_osType; DeviceType m_type; - QString m_portsSpec; + PortList m_freePorts; bool m_isDefault; Id m_internalId; }; |