aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxrunconfiguration.h
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-09-01 13:23:02 +0200
committerhjk <hjk@qt.io>2017-09-13 09:24:26 +0000
commit890c1906e6fb2eceb3eaf381b0c298138be3a932 (patch)
treeb8497216ea125ac47621451082202a25000206e7 /src/plugins/remotelinux/remotelinuxrunconfiguration.h
parent4710e6b4b2df67a9d483c33e1a2b06a4139f7baa (diff)
ProjectExplorer: Re-organize RunConfiguration constructors
The idea is to massage the setup in a way to make implementation of new configurations less error prone by identifying recurring patterns and sharing repetitive code that tends to be forgotten (see Android cloning). The former two lines of constructors (owner-and-id, owner-and-source) are split into a simple, shared, constructor and new setId() and copyFrom() functions. The change is mostly mechanical, some multiple calls to fromMap have been removed, though, some consts added. Otherwise, to keep the patch small it temporarily introduces two helper templates in IRunConfigurationFactory. Also, setId() signatures have not been unified yet. These won't be needed in the final setup. Change-Id: I8c0734496caae744a9883fe6d92c1d8f8e0234ea Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxrunconfiguration.h')
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfiguration.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
index badf329d11..b4ef39a737 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h
+++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
@@ -34,21 +34,16 @@
namespace RemoteLinux {
class RemoteLinuxRunConfigurationWidget;
-namespace Internal {
-class RemoteLinuxRunConfigurationPrivate;
-class RemoteLinuxRunConfigurationFactory;
-} // namespace Internal
+namespace Internal { class RemoteLinuxRunConfigurationPrivate; }
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
- Q_DISABLE_COPY(RemoteLinuxRunConfiguration)
- friend class Internal::RemoteLinuxRunConfigurationFactory;
friend class RemoteLinuxRunConfigurationWidget;
+ friend class ProjectExplorer::IRunConfigurationFactory;
public:
- RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, Core::Id id,
- const QString &targetName);
+ explicit RemoteLinuxRunConfiguration(ProjectExplorer::Target *target);
~RemoteLinuxRunConfiguration() override;
QWidget *createConfigurationWidget() override;
@@ -79,14 +74,14 @@ signals:
void targetInformationChanged() const;
protected:
- RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent,
- RemoteLinuxRunConfiguration *source);
+ void initialize(Core::Id id, const QString &targetName);
+ void copyFrom(const RemoteLinuxRunConfiguration *source);
+
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName();
private:
void handleBuildSystemDataUpdated();
- void init();
Internal::RemoteLinuxRunConfigurationPrivate * const d;
};