diff options
author | Jarek Kobus <[email protected]> | 2023-08-18 12:59:14 +0200 |
---|---|---|
committer | Jarek Kobus <[email protected]> | 2023-08-18 11:33:08 +0000 |
commit | f62575fd5db13a2a56087381c3d813ff91d6af5e (patch) | |
tree | 0d2a06601c725fefca9db25858e1b0aea5f22bfc /src/plugins | |
parent | 1ed27cc2eb00b07f59bff097271c6cf271b4c54c (diff) |
RemoteLinux: Inline RemoteLinuxDeployConfigurationFactory
Change-Id: I0459981d46561c63b0c4895c37e82b3bc5363777
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/remotelinux/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinux.qbs | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp | 47 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxdeployconfiguration.h | 16 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxplugin.cpp | 36 |
5 files changed, 34 insertions, 68 deletions
diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index 3b2133b85a5..b13dac3f7ed 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -18,7 +18,6 @@ add_qtc_plugin(RemoteLinux remotelinux_export.h remotelinuxcustomrunconfiguration.cpp remotelinuxcustomrunconfiguration.h remotelinuxdebugsupport.cpp remotelinuxdebugsupport.h - remotelinuxdeployconfiguration.cpp remotelinuxdeployconfiguration.h remotelinuxenvironmentaspect.cpp remotelinuxenvironmentaspect.h remotelinuxplugin.cpp remotelinuxplugin.h remotelinuxrunconfiguration.cpp remotelinuxrunconfiguration.h diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 3bf972697b2..519020b3f79 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -41,8 +41,6 @@ Project { "remotelinuxcustomrunconfiguration.h", "remotelinuxdebugsupport.cpp", "remotelinuxdebugsupport.h", - "remotelinuxdeployconfiguration.cpp", - "remotelinuxdeployconfiguration.h", "remotelinuxenvironmentaspect.cpp", "remotelinuxenvironmentaspect.h", "remotelinuxplugin.cpp", diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp deleted file mode 100644 index 537ca8ebe44..00000000000 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "remotelinuxdeployconfiguration.h" - -#include "remotelinux_constants.h" -#include "remotelinuxtr.h" - -#include <projectexplorer/devicesupport/filetransferinterface.h> -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitaspects.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> - -using namespace ProjectExplorer; - -namespace RemoteLinux::Internal { - -RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() -{ - setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux); - addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType); - setDefaultDisplayName(Tr::tr("Deploy to Remote Linux Host")); - setUseDeploymentDataView(); - - const auto needsMakeInstall = [](Target *target) - { - const Project * const prj = target->project(); - return prj->deploymentKnowledge() == DeploymentKnowledge::Bad - && prj->hasMakeInstallEquivalent(); - }; - setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { - // 4.9 -> 4.10. See QTCREATORBUG-22689. - if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) { - dc->stepList()->insertStep(0, Constants::MakeInstallStepId); - } - }); - - addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); - addInitialStep(Constants::KillAppStepId); - - // TODO: Rename RsyncDeployStep to something more generic. - addInitialStep(Constants::RsyncDeployStepId); -} - -} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h deleted file mode 100644 index 61959122b2c..00000000000 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include <projectexplorer/deployconfiguration.h> - -namespace RemoteLinux::Internal { - -class RemoteLinuxDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory -{ -public: - RemoteLinuxDeployConfigurationFactory(); -}; - -} // RemoteLinux::Internal diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 2cb96de7405..734c17408e9 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -9,11 +9,10 @@ #include "linuxdevice.h" #include "makeinstallstep.h" #include "remotelinux_constants.h" -#include "remotelinuxdeployconfiguration.h" #include "remotelinuxcustomrunconfiguration.h" #include "remotelinuxdebugsupport.h" -#include "remotelinuxdeployconfiguration.h" #include "remotelinuxrunconfiguration.h" +#include "remotelinuxtr.h" #include "rsyncdeploystep.h" #include "tarpackagecreationstep.h" #include "tarpackagedeploystep.h" @@ -22,7 +21,9 @@ #include "filesystemaccess_test.h" #endif +#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/kitaspects.h> +#include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> @@ -45,6 +46,37 @@ public: } }; +class RemoteLinuxDeployConfigurationFactory : public DeployConfigurationFactory +{ +public: + RemoteLinuxDeployConfigurationFactory() + { + setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux); + addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType); + setDefaultDisplayName(Tr::tr("Deploy to Remote Linux Host")); + setUseDeploymentDataView(); + + const auto needsMakeInstall = [](Target *target) + { + const Project * const prj = target->project(); + return prj->deploymentKnowledge() == DeploymentKnowledge::Bad + && prj->hasMakeInstallEquivalent(); + }; + setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { + // 4.9 -> 4.10. See QTCREATORBUG-22689. + if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) { + dc->stepList()->insertStep(0, Constants::MakeInstallStepId); + } + }); + + addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); + addInitialStep(Constants::KillAppStepId); + + // TODO: Rename RsyncDeployStep to something more generic. + addInitialStep(Constants::RsyncDeployStepId); + } +}; + class RemoteLinuxPluginPrivate { public: |