diff --git a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp index a8b86a87ffd..535658f0f17 100644 --- a/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp +++ b/src/plugins/boot2qt/qdbdeployconfigurationfactory.cpp @@ -52,7 +52,6 @@ QdbDeployConfigurationFactory::QdbDeployConfigurationFactory() return prj->deploymentKnowledge() == DeploymentKnowledge::Bad && prj->hasMakeInstallEquivalent(); }); - addInitialStep(RemoteLinux::Constants::CheckForFreeDiskSpaceId); addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(RemoteLinux::Constants::DirectUploadStepId); } diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 1382954c807..711cdb50099 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -45,7 +45,6 @@ #include -#include #include #include #include @@ -177,8 +176,6 @@ public: QdbStopApplicationStepFactory m_stopApplicationStepFactory; QdbMakeDefaultAppStepFactory m_makeDefaultAppStepFactory; - QdbDeployStepFactory - m_checkForFreeDiskSpaceStepFactory{RemoteLinux::Constants::CheckForFreeDiskSpaceId}; QdbDeployStepFactory m_directUploadStepFactory{RemoteLinux::Constants::DirectUploadStepId}; QdbDeployStepFactory diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index de9f7611717..d77dd327ba7 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -131,6 +131,11 @@ bool BuildStepList::fromMap(const QVariantMap &map) } bool handled = false; Utils::Id stepId = idFromMap(bsData); + + // pre-8.0 compat + if (stepId == "RemoteLinux.CheckForFreeDiskSpaceStep") + continue; + for (BuildStepFactory *factory : factories) { if (factory->stepId() == stepId) { if (factory->canHandle(this)) { diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index b939efeae77..f5cf7991ec6 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -54,7 +54,6 @@ #include #include -#include #include #include #include @@ -105,7 +104,6 @@ public: && prj->hasMakeInstallEquivalent(); }); addInitialStep(DeviceCheckBuildStep::stepId()); - addInitialStep(RemoteLinux::Constants::CheckForFreeDiskSpaceId); addInitialStep(QnxUploadStep::stepId()); } }; @@ -123,7 +121,6 @@ public: QnxDeviceFactory deviceFactory; QnxDeployConfigurationFactory deployConfigFactory; GenericQnxDeployStepFactory directUploadDeployFactory; - GenericQnxDeployStepFactory checkForFreeDiskSpaceDeployFactory; GenericQnxDeployStepFactory makeInstallDeployFactory; GenericQnxDeployStepFactory checkBuildDeployFactory; QnxRunConfigurationFactory runConfigFactory; diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index 2de46781890..a13af8cd47b 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -4,7 +4,6 @@ add_qtc_plugin(RemoteLinux SOURCES abstractremotelinuxdeployservice.cpp abstractremotelinuxdeployservice.h abstractremotelinuxdeploystep.cpp abstractremotelinuxdeploystep.h - checkforfreediskspacestep.cpp checkforfreediskspacestep.h customcommanddeploystep.cpp customcommanddeploystep.h deploymenttimeinfo.cpp deploymenttimeinfo.h genericdirectuploadservice.cpp genericdirectuploadservice.h diff --git a/src/plugins/remotelinux/checkforfreediskspacestep.cpp b/src/plugins/remotelinux/checkforfreediskspacestep.cpp deleted file mode 100644 index 3c2cb42c27b..00000000000 --- a/src/plugins/remotelinux/checkforfreediskspacestep.cpp +++ /dev/null @@ -1,153 +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 "checkforfreediskspacestep.h" - -#include "abstractremotelinuxdeployservice.h" - -#include - -#include -#include - -#include - -#include - -using namespace ProjectExplorer; -using namespace Utils; - -namespace RemoteLinux { - -class CheckForFreeDiskSpaceService : public AbstractRemoteLinuxDeployService -{ - Q_DECLARE_TR_FUNCTIONS(RemoteLinux::CheckForFreeDiskSpaceService) - -public: - CheckForFreeDiskSpaceService() {} - - void setPathToCheck(const QString &path); - void setRequiredSpaceInBytes(quint64 sizeInBytes); - -private: - bool isDeploymentNecessary() const override { return true; } - - CheckResult isDeploymentPossible() const override; - - void doDeploy() final; - void stopDeployment() final {} - - QString m_pathToCheck; - quint64 m_requiredSpaceInBytes = 0; -}; - -void CheckForFreeDiskSpaceService::setPathToCheck(const QString &path) -{ - m_pathToCheck = path; -} - -void CheckForFreeDiskSpaceService::setRequiredSpaceInBytes(quint64 sizeInBytes) -{ - m_requiredSpaceInBytes = sizeInBytes; -} - -void CheckForFreeDiskSpaceService::doDeploy() -{ - auto cleanup = qScopeGuard([this] { setFinished(); }); - const FilePath path = deviceConfiguration()->filePath(m_pathToCheck); - const qint64 freeSpace = path.bytesAvailable(); - if (freeSpace < 0) { - emit errorMessage(tr("Cannot get info about free disk space for \"%1\"") - .arg(path.displayName())); - handleDeploymentDone(); - return; - } - - const qint64 mb = 1024 * 1024; - const qint64 freeSpaceMB = freeSpace / mb; - const qint64 requiredSpaceMB = m_requiredSpaceInBytes / mb; - - if (freeSpaceMB < requiredSpaceMB) { - emit errorMessage(tr("The remote file system has only %n megabytes of free space, " - "but %1 megabytes are required.", nullptr, freeSpaceMB) - .arg(requiredSpaceMB)); - handleDeploymentDone(); - return; - } - - emit progressMessage(tr("The remote file system has %n megabytes of free space, going ahead.", - nullptr, freeSpaceMB)); - handleDeploymentDone(); -} - -CheckResult CheckForFreeDiskSpaceService::isDeploymentPossible() const -{ - if (!m_pathToCheck.startsWith('/')) { - return CheckResult::failure( - tr("Cannot check for free disk space: \"%1\" is not an absolute path.") - .arg(m_pathToCheck)); - } - - return AbstractRemoteLinuxDeployService::isDeploymentPossible(); -} - -CheckForFreeDiskSpaceStep::CheckForFreeDiskSpaceStep - (BuildStepList *bsl, Id id) - : AbstractRemoteLinuxDeployStep(bsl, id) -{ - auto service = createDeployService(); - - auto pathToCheckAspect = addAspect(); - pathToCheckAspect->setSettingsKey("RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck"); - pathToCheckAspect->setDisplayStyle(StringAspect::LineEditDisplay); - pathToCheckAspect->setValue("/"); - pathToCheckAspect->setLabelText(tr("Remote path to check for free space:")); - - auto requiredSpaceAspect = addAspect(); - requiredSpaceAspect->setSettingsKey("RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace"); - requiredSpaceAspect->setLabel(tr("Required disk space:")); - requiredSpaceAspect->setDisplayScaleFactor(1024*1024); - requiredSpaceAspect->setValue(5*1024*1024); - requiredSpaceAspect->setSuffix(tr("MB")); - requiredSpaceAspect->setRange(1, std::numeric_limits::max()); - - setInternalInitializer([service, pathToCheckAspect, requiredSpaceAspect] { - service->setPathToCheck(pathToCheckAspect->value()); - service->setRequiredSpaceInBytes(requiredSpaceAspect->value()); - return CheckResult::success(); - }); -} - -Id CheckForFreeDiskSpaceStep::stepId() -{ - return "RemoteLinux.CheckForFreeDiskSpaceStep"; -} - -QString CheckForFreeDiskSpaceStep::displayName() -{ - return tr("Check for free disk space"); -} - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/checkforfreediskspacestep.h b/src/plugins/remotelinux/checkforfreediskspacestep.h deleted file mode 100644 index e1ff4c3765e..00000000000 --- a/src/plugins/remotelinux/checkforfreediskspacestep.h +++ /dev/null @@ -1,45 +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 "remotelinux_export.h" - -#include "abstractremotelinuxdeploystep.h" - -namespace RemoteLinux { - -class REMOTELINUX_EXPORT CheckForFreeDiskSpaceStep : public AbstractRemoteLinuxDeployStep -{ - Q_OBJECT - -public: - CheckForFreeDiskSpaceStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - - static Utils::Id stepId(); - static QString displayName(); -}; - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 859c8f249d7..8aaf6fbcc2e 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -19,8 +19,6 @@ Project { "abstractremotelinuxdeploystep.h", "deploymenttimeinfo.cpp", "deploymenttimeinfo.h", - "checkforfreediskspacestep.cpp", - "checkforfreediskspacestep.h", "customcommanddeploystep.cpp", "customcommanddeploystep.h", "genericdirectuploadservice.cpp", diff --git a/src/plugins/remotelinux/remotelinux_constants.h b/src/plugins/remotelinux/remotelinux_constants.h index da6eac43d40..909d327e5d3 100644 --- a/src/plugins/remotelinux/remotelinux_constants.h +++ b/src/plugins/remotelinux/remotelinux_constants.h @@ -32,7 +32,6 @@ const char GenericLinuxOsType[] = "GenericLinuxOsType"; const char DeployToGenericLinux[] = "DeployToGenericLinux"; -const char CheckForFreeDiskSpaceId[] = "RemoteLinux.CheckForFreeDiskSpaceStep"; const char DirectUploadStepId[] = "RemoteLinux.DirectUploadStep"; const char MakeInstallStepId[] = "RemoteLinux.MakeInstall"; const char TarPackageCreationStepId[] = "MaemoTarPackageCreationStep"; diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp index db5ecfc5280..37a44298017 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp @@ -63,7 +63,6 @@ RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() }); addInitialStep(Constants::MakeInstallStepId, needsMakeInstall); - addInitialStep(Constants::CheckForFreeDiskSpaceId); addInitialStep(Constants::KillAppStepId); addInitialStep(Constants::RsyncDeployStepId, [](Target *target) { auto device = DeviceKitAspect::device(target->kit()); diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 1f072a38a50..5e4cbd1c266 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -25,7 +25,6 @@ #include "remotelinuxplugin.h" -#include "checkforfreediskspacestep.h" #include "customcommanddeploystep.h" #include "genericdirectuploadstep.h" #include "killappstep.h" @@ -79,7 +78,6 @@ public: GenericDeployStepFactory genericDirectUploadStepFactory; GenericDeployStepFactory rsyncDeployStepFactory; CustomCommandDeployStepFactory customCommandDeployStepFactory; - GenericDeployStepFactory checkForFreeDiskSpaceStepFactory; GenericDeployStepFactory killAppStepFactory; GenericDeployStepFactory makeInstallStepFactory;