From 4235b0dae24c26727c0675299c0f9349c47f43b2 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 7 Sep 2017 09:51:46 +0200 Subject: [PATCH] RemoteLinux: Remove abstractremotelinuxrunsupport.{h,cpp} There was only the now-unused FifoGatherer left, which could, if really needed again, be re-instated near the actual worker that would need it. Also, un-export LinuxDeviceDebugSupport and RemoteLinuxQmlProfilerSupport which are not re-used, and conceptually not meant to be re-used, anymore. Change-Id: I20b6eb2f4a85180b586ea8338cf74173e3b7b21c Reviewed-by: Christian Kandeler --- .../abstractremotelinuxrunsupport.cpp | 99 ------------------- .../abstractremotelinuxrunsupport.h | 54 ---------- src/plugins/remotelinux/remotelinux.pro | 2 - src/plugins/remotelinux/remotelinux.qbs | 2 - .../remotelinux/remotelinuxanalyzesupport.cpp | 16 +-- .../remotelinux/remotelinuxanalyzesupport.h | 10 +- .../remotelinux/remotelinuxdebugsupport.cpp | 2 + .../remotelinux/remotelinuxdebugsupport.h | 6 +- 8 files changed, 10 insertions(+), 181 deletions(-) delete mode 100644 src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp delete mode 100644 src/plugins/remotelinux/abstractremotelinuxrunsupport.h diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp deleted file mode 100644 index 48aac088138..00000000000 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp +++ /dev/null @@ -1,99 +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 "abstractremotelinuxrunsupport.h" - -#include -#include -#include - -#include -#include -#include - -#include - -using namespace ProjectExplorer; -using namespace Utils; - -namespace RemoteLinux { - -// FifoGatherer - -FifoGatherer::FifoGatherer(RunControl *runControl) - : RunWorker(runControl) -{ - setDisplayName("FifoGatherer"); -} - -FifoGatherer::~FifoGatherer() -{ -} - -void FifoGatherer::start() -{ - appendMessage(tr("Creating remote socket...") + '\n', NormalMessageFormat); - - StandardRunnable r; - r.executable = QLatin1String("/bin/sh"); - r.commandLineArguments = "-c 'd=`mktemp -d` && mkfifo $d/fifo && echo -n $d/fifo'"; - r.workingDirectory = QLatin1String("/tmp"); - r.runMode = ApplicationLauncher::Console; - - QSharedPointer output(new QString); - QSharedPointer errors(new QString); - - connect(&m_fifoCreator, &ApplicationLauncher::finished, - this, [this, output, errors](bool success) { - if (!success) { - reportFailure(QString("Failed to create fifo: %1").arg(*errors)); - } else { - m_fifo = *output; - appendMessage(tr("Created fifo: %1").arg(m_fifo), NormalMessageFormat); - reportStarted(); - } - }); - - connect(&m_fifoCreator, &ApplicationLauncher::remoteStdout, - this, [output](const QString &data) { - output->append(data); - }); - - connect(&m_fifoCreator, &ApplicationLauncher::remoteStderr, - this, [this, errors](const QString &) { - reportFailure(); -// errors->append(data); - }); - - m_fifoCreator.start(r, device()); -} - -void FifoGatherer::stop() -{ - m_fifoCreator.stop(); - reportStopped(); -} - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h deleted file mode 100644 index 4f6589ab1f2..00000000000 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h +++ /dev/null @@ -1,54 +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 - -namespace RemoteLinux { - -class REMOTELINUX_EXPORT FifoGatherer : public ProjectExplorer::RunWorker -{ - Q_OBJECT - -public: - explicit FifoGatherer(ProjectExplorer::RunControl *runControl); - ~FifoGatherer(); - - QString fifo() const { return m_fifo; } - -private: - void start() override; - void stop() override; - - void createRemoteFifo(); - - ProjectExplorer::ApplicationLauncher m_fifoCreator; - QString m_fifo; -}; - -} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro index 5167f61acee..b667c040abb 100644 --- a/src/plugins/remotelinux/remotelinux.pro +++ b/src/plugins/remotelinux/remotelinux.pro @@ -43,7 +43,6 @@ HEADERS += \ remotelinuxcheckforfreediskspaceservice.h \ remotelinuxcheckforfreediskspacestep.h \ remotelinuxanalyzesupport.h \ - abstractremotelinuxrunsupport.h \ linuxdeviceprocess.h \ remotelinuxcustomrunconfiguration.h \ remotelinuxsignaloperation.h \ @@ -88,7 +87,6 @@ SOURCES += \ remotelinuxcheckforfreediskspaceservice.cpp \ remotelinuxcheckforfreediskspacestep.cpp \ remotelinuxanalyzesupport.cpp \ - abstractremotelinuxrunsupport.cpp \ linuxdeviceprocess.cpp \ remotelinuxcustomrunconfiguration.cpp \ remotelinuxsignaloperation.cpp \ diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 3855efc24bb..5ad7f7abe44 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -23,8 +23,6 @@ Project { "abstractremotelinuxdeployservice.h", "abstractremotelinuxdeploystep.cpp", "abstractremotelinuxdeploystep.h", - "abstractremotelinuxrunsupport.cpp", - "abstractremotelinuxrunsupport.h", "abstractuploadandinstallpackageservice.cpp", "abstractuploadandinstallpackageservice.h", "deploymenttimeinfo.cpp", diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index 4cdd6f9d4e7..aaf384cf679 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -25,30 +25,17 @@ #include "remotelinuxanalyzesupport.h" -#include "remotelinuxrunconfiguration.h" - -#include -#include -#include -#include -#include #include -#include -#include - #include -#include #include -#include - -using namespace QSsh; using namespace ProjectExplorer; using namespace Utils; namespace RemoteLinux { +namespace Internal { // RemoteLinuxQmlProfilerSupport @@ -89,4 +76,5 @@ void RemoteLinuxQmlProfilerSupport::start() SimpleTargetRunner::start(); } +} // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.h b/src/plugins/remotelinux/remotelinuxanalyzesupport.h index 431829aa1bd..6b444fc97c3 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.h +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.h @@ -25,18 +25,14 @@ #pragma once -#include "abstractremotelinuxrunsupport.h" - #include #include namespace RemoteLinux { +namespace Internal { -class REMOTELINUX_EXPORT RemoteLinuxQmlProfilerSupport - : public ProjectExplorer::SimpleTargetRunner +class RemoteLinuxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner { - Q_OBJECT - public: RemoteLinuxQmlProfilerSupport(ProjectExplorer::RunControl *runControl); @@ -47,5 +43,5 @@ private: ProjectExplorer::RunWorker *m_profiler; }; - +} // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 40a00a600d6..1687eb1808e 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -32,6 +32,7 @@ using namespace Debugger; using namespace ProjectExplorer; namespace RemoteLinux { +namespace Internal { LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl) : DebuggerRunTool(runControl) @@ -67,4 +68,5 @@ void LinuxDeviceDebugSupport::start() DebuggerRunTool::start(); } +} // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.h b/src/plugins/remotelinux/remotelinuxdebugsupport.h index 6b2bf6559af..1b7a0ee3ac2 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.h +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.h @@ -25,13 +25,12 @@ #pragma once -#include "abstractremotelinuxrunsupport.h" - #include namespace RemoteLinux { +namespace Internal { -class REMOTELINUX_EXPORT LinuxDeviceDebugSupport : public Debugger::DebuggerRunTool +class LinuxDeviceDebugSupport : public Debugger::DebuggerRunTool { public: LinuxDeviceDebugSupport(ProjectExplorer::RunControl *runControl); @@ -42,4 +41,5 @@ private: Debugger::GdbServerPortsGatherer *m_portsGatherer = nullptr; }; +} // namespace Internal } // namespace RemoteLinux