RemoteLinux: Move RunConfigurationFactories close to RunConfigurations

No need to have a dozen lines of code in a separate translation
unit and more in line with what others do nowadays.

Change-Id: I029cac3d96b6a318be2cc4efad08badfae68fc20
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-04-06 13:33:55 +02:00
parent 8183809846
commit ef79078db2
9 changed files with 38 additions and 112 deletions

View File

@@ -15,7 +15,6 @@ HEADERS += \
genericlinuxdeviceconfigurationwizard.h \
genericlinuxdeviceconfigurationfactory.h \
remotelinuxrunconfigurationwidget.h \
remotelinuxrunconfigurationfactory.h \
remotelinuxdebugsupport.h \
genericlinuxdeviceconfigurationwizardpages.h \
abstractremotelinuxdeploystep.h \
@@ -60,7 +59,6 @@ SOURCES += \
genericlinuxdeviceconfigurationwizard.cpp \
genericlinuxdeviceconfigurationfactory.cpp \
remotelinuxrunconfigurationwidget.cpp \
remotelinuxrunconfigurationfactory.cpp \
remotelinuxdebugsupport.cpp \
genericlinuxdeviceconfigurationwizardpages.cpp \
abstractremotelinuxdeploystep.cpp \

View File

@@ -92,8 +92,6 @@ Project {
"remotelinuxqmltoolingsupport.h",
"remotelinuxrunconfiguration.cpp",
"remotelinuxrunconfiguration.h",
"remotelinuxrunconfigurationfactory.cpp",
"remotelinuxrunconfigurationfactory.h",
"remotelinuxrunconfigurationwidget.cpp",
"remotelinuxrunconfigurationwidget.h",
"remotelinuxsignaloperation.cpp",

View File

@@ -25,6 +25,7 @@
#include "remotelinuxcustomrunconfiguration.h"
#include "remotelinux_constants.h"
#include "remotelinuxenvironmentaspect.h"
#include "ui_remotelinuxcustomrunconfigurationwidget.h"
@@ -202,6 +203,17 @@ QVariantMap RemoteLinuxCustomRunConfiguration::toMap() const
return map;
}
// RemoteLinuxCustomRunConfigurationFactory
RemoteLinuxCustomRunConfigurationFactory::RemoteLinuxCustomRunConfigurationFactory()
: FixedRunConfigurationFactory(RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName(),
true)
{
registerRunConfiguration<RemoteLinuxCustomRunConfiguration>
(RemoteLinuxCustomRunConfiguration::runConfigId());
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}
} // namespace Internal
} // namespace RemoteLinux

View File

@@ -61,5 +61,13 @@ private:
QString m_workingDirectory;
};
class RemoteLinuxCustomRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
{
Q_OBJECT
public:
RemoteLinuxCustomRunConfigurationFactory();
};
} // namespace Internal
} // namespace RemoteLinux

View File

@@ -33,7 +33,6 @@
#include "remotelinuxdebugsupport.h"
#include "remotelinuxdeployconfiguration.h"
#include "remotelinuxrunconfiguration.h"
#include "remotelinuxrunconfigurationfactory.h"
#include "genericdirectuploadstep.h"
#include "remotelinuxcheckforfreediskspacestep.h"

View File

@@ -25,6 +25,7 @@
#include "remotelinuxrunconfiguration.h"
#include "remotelinux_constants.h"
#include "remotelinuxenvironmentaspect.h"
#include "remotelinuxrunconfigurationwidget.h"
@@ -200,4 +201,13 @@ void RemoteLinuxRunConfiguration::handleBuildSystemDataUpdated()
const char *RemoteLinuxRunConfiguration::IdPrefix = "RemoteLinuxRunConfiguration:";
// RemoteLinuxRunConfigurationFactory
RemoteLinuxRunConfigurationFactory::RemoteLinuxRunConfigurationFactory()
{
registerRunConfiguration<RemoteLinuxRunConfiguration>(RemoteLinuxRunConfiguration::IdPrefix);
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}
} // namespace RemoteLinux

View File

@@ -82,4 +82,12 @@ private:
Internal::RemoteLinuxRunConfigurationPrivate * const d;
};
class RemoteLinuxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
{
Q_OBJECT
public:
RemoteLinuxRunConfigurationFactory();
};
} // namespace RemoteLinux

View File

@@ -1,57 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "remotelinuxrunconfigurationfactory.h"
#include "remotelinux_constants.h"
#include "remotelinuxcustomrunconfiguration.h"
#include "remotelinuxrunconfiguration.h"
using namespace ProjectExplorer;
namespace RemoteLinux {
namespace Internal {
// RemoteLinuxRunConfigurationFactory
RemoteLinuxRunConfigurationFactory::RemoteLinuxRunConfigurationFactory()
{
registerRunConfiguration<RemoteLinuxRunConfiguration>(RemoteLinuxRunConfiguration::IdPrefix);
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}
// RemoteLinuxCustomRunConfigurationFactory
RemoteLinuxCustomRunConfigurationFactory::RemoteLinuxCustomRunConfigurationFactory()
: FixedRunConfigurationFactory(RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName(),
true)
{
registerRunConfiguration<RemoteLinuxCustomRunConfiguration>
(RemoteLinuxCustomRunConfiguration::runConfigId());
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}
} // namespace Internal
} // namespace RemoteLinux

View File

@@ -1,50 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/runconfiguration.h>
namespace RemoteLinux {
namespace Internal {
class RemoteLinuxRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
{
Q_OBJECT
public:
RemoteLinuxRunConfigurationFactory();
};
class RemoteLinuxCustomRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory
{
Q_OBJECT
public:
RemoteLinuxCustomRunConfigurationFactory();
};
} // namespace Internal
} // namespace RemoteLinux