Commit 169be441 authored by Christian Kandeler's avatar Christian Kandeler

RemoteLinux: Export LinuxDeviceConfigurations.

Specialized plug-ins might want to manipulate the device list
themselves, e.g. to add auto-detected devices.

Change-Id: I29b9bfd70c03bc83be86fc55c2023aed90f8ed62
Reviewed-on: http://codereview.qt.nokia.com/2944Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent d0ba9a86
...@@ -49,16 +49,16 @@ class SshConnectionParameters; ...@@ -49,16 +49,16 @@ class SshConnectionParameters;
} }
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfigurations;
class PortList; class PortList;
namespace Internal { namespace Internal {
class LinuxDeviceConfigurationPrivate; class LinuxDeviceConfigurationPrivate;
class LinuxDeviceConfigurations;
} // namespace Internal } // namespace Internal
class REMOTELINUX_EXPORT LinuxDeviceConfiguration class REMOTELINUX_EXPORT LinuxDeviceConfiguration
{ {
friend class Internal::LinuxDeviceConfigurations; friend class LinuxDeviceConfigurations;
public: public:
typedef QSharedPointer<LinuxDeviceConfiguration> Ptr; typedef QSharedPointer<LinuxDeviceConfiguration> Ptr;
typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr; typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr;
......
...@@ -33,21 +33,23 @@ ...@@ -33,21 +33,23 @@
#define LINUXDEVICECONFIGURATIONS_H #define LINUXDEVICECONFIGURATIONS_H
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "remotelinux_export.h"
#include <QtCore/QAbstractListModel> #include <QtCore/QAbstractListModel>
#include <QtCore/QList>
#include <QtCore/QSharedPointer>
#include <QtCore/QString>
QT_FORWARD_DECLARE_CLASS(QString)
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class LinuxDeviceConfigurationsPrivate;
} // namespace Internal
class LinuxDeviceConfigurations : public QAbstractListModel class REMOTELINUX_EXPORT LinuxDeviceConfigurations : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
friend class LinuxDeviceConfigurationsSettingsWidget;
public: public:
~LinuxDeviceConfigurations();
static LinuxDeviceConfigurations *instance(QObject *parent = 0); static LinuxDeviceConfigurations *instance(QObject *parent = 0);
static void replaceInstance(const LinuxDeviceConfigurations *other); static void replaceInstance(const LinuxDeviceConfigurations *other);
...@@ -60,9 +62,10 @@ public: ...@@ -60,9 +62,10 @@ public:
int indexForInternalId(LinuxDeviceConfiguration::Id internalId) const; int indexForInternalId(LinuxDeviceConfiguration::Id internalId) const;
LinuxDeviceConfiguration::Id internalId(LinuxDeviceConfiguration::ConstPtr devConf) const; LinuxDeviceConfiguration::Id internalId(LinuxDeviceConfiguration::ConstPtr devConf) const;
void setDefaultSshKeyFilePath(const QString &path) { m_defaultSshKeyFilePath = path; } void setDefaultSshKeyFilePath(const QString &path);
QString defaultSshKeyFilePath() const { return m_defaultSshKeyFilePath; } QString defaultSshKeyFilePath() const;
void addConfiguration(const LinuxDeviceConfiguration::Ptr &devConfig);
void removeConfiguration(int index); void removeConfiguration(int index);
void setConfigurationName(int i, const QString &name); void setConfigurationName(int i, const QString &name);
void setSshParameters(int i, const Utils::SshConnectionParameters &params); void setSshParameters(int i, const Utils::SshConnectionParameters &params);
...@@ -78,20 +81,16 @@ signals: ...@@ -78,20 +81,16 @@ signals:
private: private:
LinuxDeviceConfigurations(QObject *parent); LinuxDeviceConfigurations(QObject *parent);
void load(); void load();
void save(); void save();
static void copy(const LinuxDeviceConfigurations *source, static void copy(const LinuxDeviceConfigurations *source,
LinuxDeviceConfigurations *target, bool deep); LinuxDeviceConfigurations *target, bool deep);
void addConfiguration(const LinuxDeviceConfiguration::Ptr &devConfig);
void ensureOneDefaultConfigurationPerOsType(); void ensureOneDefaultConfigurationPerOsType();
static LinuxDeviceConfigurations *m_instance; Internal::LinuxDeviceConfigurationsPrivate * const m_d;
LinuxDeviceConfiguration::Id m_nextId;
QList<LinuxDeviceConfiguration::Ptr> m_devConfigs;
QString m_defaultSshKeyFilePath;
}; };
} // namespace Internal
} // namespace RemoteLinux } // namespace RemoteLinux
#endif // LINUXDEVICECONFIGURATIONS_H #endif // LINUXDEVICECONFIGURATIONS_H
...@@ -48,11 +48,10 @@ QT_END_NAMESPACE ...@@ -48,11 +48,10 @@ QT_END_NAMESPACE
namespace RemoteLinux { namespace RemoteLinux {
class ILinuxDeviceConfigurationFactory; class ILinuxDeviceConfigurationFactory;
class LinuxDeviceConfiguration; class LinuxDeviceConfiguration;
class LinuxDeviceConfigurations;
namespace Internal { namespace Internal {
class NameValidator; class NameValidator;
class LinuxDeviceConfigurations;
class LinuxDeviceConfigurationsSettingsWidget : public QWidget class LinuxDeviceConfigurationsSettingsWidget : public QWidget
{ {
......
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