diff options
author | Jarek Kobus <[email protected]> | 2022-05-06 02:26:52 +0200 |
---|---|---|
committer | Jarek Kobus <[email protected]> | 2022-05-09 07:42:13 +0000 |
commit | 2856091c757c61aeff1ec6e3981d4ed9c8b0a6b6 (patch) | |
tree | 7249ac4733dd53db0d8707859eec23cff5d1c839 /src/libs/ssh | |
parent | d8ee25ec3db039368ac0440af647fd7afd80079b (diff) |
Get rid of SshRemoteProcess
It's being replaced by QtcProcess with path on device.
Change-Id: I29eb038d1b17151683f86855eb547e47f7f7dea5
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/libs/ssh')
-rw-r--r-- | src/libs/ssh/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/libs/ssh/ssh.qbs | 2 | ||||
-rw-r--r-- | src/libs/ssh/sshconnection.cpp | 13 | ||||
-rw-r--r-- | src/libs/ssh/sshconnection.h | 5 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.cpp | 116 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.h | 59 |
6 files changed, 0 insertions, 196 deletions
diff --git a/src/libs/ssh/CMakeLists.txt b/src/libs/ssh/CMakeLists.txt index d4613851e68..0358b30d1e2 100644 --- a/src/libs/ssh/CMakeLists.txt +++ b/src/libs/ssh/CMakeLists.txt @@ -13,6 +13,5 @@ add_qtc_library(QtcSsh sshconnectionmanager.cpp sshconnectionmanager.h sshkeycreationdialog.cpp sshkeycreationdialog.h sshkeycreationdialog.ui sshlogging.cpp sshlogging_p.h - sshremoteprocess.cpp sshremoteprocess.h sshsettings.cpp sshsettings.h ) diff --git a/src/libs/ssh/ssh.qbs b/src/libs/ssh/ssh.qbs index b853cc8b660..9f7c880b953 100644 --- a/src/libs/ssh/ssh.qbs +++ b/src/libs/ssh/ssh.qbs @@ -31,8 +31,6 @@ Project { "sshkeycreationdialog.ui", "sshlogging.cpp", "sshlogging_p.h", - "sshremoteprocess.cpp", - "sshremoteprocess.h", "sshsettings.cpp", "sshsettings.h", ] diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index 145a2f60bcd..df4b9a0a0e2 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -27,7 +27,6 @@ #include "sftptransfer.h" #include "sshlogging_p.h" -#include "sshremoteprocess.h" #include "sshsettings.h" #include <utils/fileutils.h> @@ -286,18 +285,6 @@ SshConnection::~SshConnection() delete d; } -SshRemoteProcessPtr SshConnection::createRemoteProcess(const QString &command) -{ - QTC_ASSERT(state() == Connected, return SshRemoteProcessPtr()); - return SshRemoteProcessPtr(new SshRemoteProcess(command, - d->connectionArgs(SshSettings::sshFilePath()))); -} - -SshRemoteProcessPtr SshConnection::createRemoteShell() -{ - return createRemoteProcess({}); -} - SftpTransferPtr SshConnection::createUpload(const FilesToTransfer &files, FileTransferErrorHandling errorHandlingMode) { diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index b2d2abc27ad..633e620791b 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -41,7 +41,6 @@ namespace Utils { class QtcProcess; } namespace QSsh { -class SshRemoteProcess; enum SshHostKeyCheckingMode { SshHostKeyCheckingNone, @@ -82,8 +81,6 @@ public: QSSH_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2); QSSH_EXPORT bool operator!=(const SshConnectionParameters &p1, const SshConnectionParameters &p2); -using SshRemoteProcessPtr = std::unique_ptr<SshRemoteProcess>; - class QSSH_EXPORT SshConnection : public QObject { Q_OBJECT @@ -102,8 +99,6 @@ public: bool sharingEnabled() const; ~SshConnection(); - SshRemoteProcessPtr createRemoteProcess(const QString &command); - SshRemoteProcessPtr createRemoteShell(); SftpTransferPtr createUpload(const FilesToTransfer &files, FileTransferErrorHandling errorHandlingMode); SftpTransferPtr createDownload(const FilesToTransfer &files, diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp deleted file mode 100644 index f0b52d5ff27..00000000000 --- a/src/libs/ssh/sshremoteprocess.cpp +++ /dev/null @@ -1,116 +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 "sshremoteprocess.h" - -#include "sshconnection.h" -#include "sshlogging_p.h" -#include "sshsettings.h" - -#include <utils/commandline.h> -#include <utils/processinterface.h> -#include <utils/qtcassert.h> - -#include <QTimer> - -/*! - \class QSsh::SshRemoteProcess - - \brief The SshRemoteProcess class implements an SSH channel for running a - remote process. - - Objects are created via SshConnection::createRemoteProcess. - The process is started via the start() member function. - If the process needs a pseudo terminal, you can request one - via requestTerminal() before calling start(). - */ - -using namespace QSsh::Internal; -using namespace Utils; - -namespace QSsh { - -SshRemoteProcess::SshRemoteProcess(const QString &command, const QStringList &connectionArgs) - : QtcProcess() -{ - SshConnectionParameters::setupSshEnvironment(this); - m_remoteCommand = command; - m_connectionArgs = connectionArgs; -} - -void SshRemoteProcess::emitFinished() -{ - if (exitStatus() == QProcess::CrashExit) - m_errorString = tr("The ssh process crashed: %1").arg(errorString()); - QtcProcess::emitFinished(); -} - -void SshRemoteProcess::startImpl() -{ - QTC_ASSERT(!isRunning(), return); - m_errorString.clear(); - const CommandLine cmd = fullLocalCommandLine(); - if (!m_displayName.isEmpty()) { - Environment env = environment(); - env.set("DISPLAY", m_displayName); - setEnvironment(env); - } - qCDebug(sshLog) << "starting remote process:" << cmd.toUserOutput(); - setCommand(cmd); - QtcProcess::startImpl(); -} - -ProcessResultData SshRemoteProcess::resultData() const -{ - ProcessResultData result = QtcProcess::resultData(); - if (!m_errorString.isEmpty()) - result.m_errorString = m_errorString; - return result; -} - -void SshRemoteProcess::requestX11Forwarding(const QString &displayName) -{ - m_displayName = displayName; -} - -CommandLine SshRemoteProcess::fullLocalCommandLine(bool inTerminal) const -{ - CommandLine cmd {SshSettings::sshFilePath()}; - - if (!m_displayName.isEmpty()) - cmd.addArg("-X"); - if (inTerminal) - cmd.addArg("-tt"); - - cmd.addArg("-q"); - cmd.addArgs(m_connectionArgs); - - if (!m_remoteCommand.isEmpty()) - cmd.addArg(m_remoteCommand); - - return cmd; -} - -} // namespace QSsh diff --git a/src/libs/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h deleted file mode 100644 index cfd6427c732..00000000000 --- a/src/libs/ssh/sshremoteprocess.h +++ /dev/null @@ -1,59 +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 "ssh_global.h" - -#include <utils/qtcprocess.h> - -namespace Utils { class CommandLine; } - -namespace QSsh { - -class QSSH_EXPORT SshRemoteProcess : public Utils::QtcProcess -{ - Q_OBJECT - -public: - SshRemoteProcess(const QString &command, const QStringList &connectionArgs); - - void requestX11Forwarding(const QString &displayName); - void startImpl() override; - Utils::ProcessResultData resultData() const override; - - Utils::CommandLine fullLocalCommandLine(bool inTerminal = false) const; - -protected: - void emitFinished() override; - -private: - QString m_remoteCommand; - QStringList m_connectionArgs; - QString m_displayName; - QString m_errorString; -}; - -} // namespace QSsh |