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