From 8af62eb25614a9c4785c71ed523a00496e5eea6d Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 28 Feb 2022 12:25:26 +0100 Subject: [PATCH] DeviceProcess: Minimize the usage of DeviceProcess DeviceProcess doesn't provide any public API, so replace all usages of it with QtcProcess. Keep using DeviceProcess only for reimplementations. Change-Id: I35a14251a81dd0dde426f56ca2e809b527cc863c Reviewed-by: hjk Reviewed-by: --- src/plugins/boot2qt/qdbdevice.cpp | 2 +- src/plugins/boot2qt/qdbdevice.h | 2 +- src/plugins/debugger/gdb/gdbengine.cpp | 1 - src/plugins/docker/dockerdevice.cpp | 8 ++++---- src/plugins/docker/dockerdevice.h | 2 +- src/plugins/mcusupport/mcusupportdevice.cpp | 1 - .../project/mesonprocess.cpp | 1 + .../mesonprojectmanager/project/mesonprocess.h | 5 ++--- src/plugins/perfprofiler/perfconfigwidget.cpp | 9 ++++++--- src/plugins/perfprofiler/perfconfigwidget.h | 13 +++++++++---- .../perfprofiler/perfprofilerruncontrol.cpp | 17 ++++++++--------- .../perfprofiler/perftracepointdialog.cpp | 11 +++++------ src/plugins/perfprofiler/perftracepointdialog.h | 8 ++------ .../projectexplorer/applicationlauncher.cpp | 1 - .../devicesupport/desktopdevice.cpp | 2 +- .../devicesupport/desktopdevice.h | 2 +- .../devicesupport/deviceusedportsgatherer.cpp | 12 ++++++------ .../projectexplorer/devicesupport/idevice.cpp | 2 +- .../projectexplorer/devicesupport/idevice.h | 3 +-- src/plugins/qnx/qnxdevice.cpp | 6 +++--- src/plugins/qnx/qnxdevice.h | 2 +- src/plugins/qnx/slog2inforunner.cpp | 10 +++++----- src/plugins/remotelinux/linuxdevice.cpp | 8 ++++---- src/plugins/remotelinux/linuxdevice.h | 2 +- src/plugins/remotelinux/linuxdeviceprocess.cpp | 4 ++-- .../remotelinuxenvironmentreader.cpp | 6 +++--- .../remotelinux/remotelinuxenvironmentreader.h | 4 +--- src/plugins/webassembly/webassemblydevice.cpp | 1 - 28 files changed, 70 insertions(+), 75 deletions(-) diff --git a/src/plugins/boot2qt/qdbdevice.cpp b/src/plugins/boot2qt/qdbdevice.cpp index a0ac528fa8e..3f3919472d0 100644 --- a/src/plugins/boot2qt/qdbdevice.cpp +++ b/src/plugins/boot2qt/qdbdevice.cpp @@ -167,7 +167,7 @@ ProjectExplorer::IDeviceWidget *QdbDevice::createWidget() return w; } -ProjectExplorer::DeviceProcess *QdbDevice::createProcess(QObject *parent) const +QtcProcess *QdbDevice::createProcess(QObject *parent) const { return new QdbDeviceProcess(sharedFromThis(), parent); } diff --git a/src/plugins/boot2qt/qdbdevice.h b/src/plugins/boot2qt/qdbdevice.h index 191a410633d..3148cf6fe8a 100644 --- a/src/plugins/boot2qt/qdbdevice.h +++ b/src/plugins/boot2qt/qdbdevice.h @@ -44,7 +44,7 @@ public: ProjectExplorer::IDeviceWidget *createWidget() final; - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const final; + Utils::QtcProcess *createProcess(QObject *parent) const final; void setSerialNumber(const QString &serial); QString serialNumber() const; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index c949e9b2a6b..8809ec6473f 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -54,7 +54,6 @@ #include #include -#include #include #include diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 8775e2aae4b..eae2ff8a0ed 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -121,10 +121,10 @@ void DockerDeviceProcess::start() DockerDevice::ConstPtr dockerDevice = qSharedPointerCast(device()); QTC_ASSERT(dockerDevice, return); - connect(this, &DeviceProcess::readyReadStandardOutput, this, [this] { + connect(this, &QtcProcess::readyReadStandardOutput, this, [this] { MessageManager::writeSilently(QString::fromLocal8Bit(readAllStandardError())); }); - connect(this, &DeviceProcess::readyReadStandardError, this, [this] { + connect(this, &QtcProcess::readyReadStandardError, this, [this] { MessageManager::writeDisrupting(QString::fromLocal8Bit(readAllStandardError())); }); @@ -495,7 +495,7 @@ DockerDevice::DockerDevice(const DockerDeviceData &data) QObject::connect(proc, &QtcProcess::finished, proc, &QObject::deleteLater); - QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] { + QObject::connect(proc, &QtcProcess::errorOccurred, [proc] { MessageManager::writeDisrupting(tr("Error starting remote shell.")); proc->deleteLater(); }); @@ -938,7 +938,7 @@ QVariantMap DockerDevice::toMap() const return map; } -DeviceProcess *DockerDevice::createProcess(QObject *parent) const +QtcProcess *DockerDevice::createProcess(QObject *parent) const { return new DockerDeviceProcess(sharedFromThis(), parent); } diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 394d92a0929..7eb980e8ca2 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -66,7 +66,7 @@ public: QList validate() const override; bool canCreateProcess() const override { return true; } - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override; + Utils::QtcProcess *createProcess(QObject *parent) const override; bool canAutoDetectPorts() const override; ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override; bool canCreateProcessModel() const override { return false; } diff --git a/src/plugins/mcusupport/mcusupportdevice.cpp b/src/plugins/mcusupport/mcusupportdevice.cpp index 46fb430ac22..876bddd06fd 100644 --- a/src/plugins/mcusupport/mcusupportdevice.cpp +++ b/src/plugins/mcusupport/mcusupportdevice.cpp @@ -26,7 +26,6 @@ #include "mcusupportdevice.h" #include "mcusupportconstants.h" -#include #include using namespace ProjectExplorer; diff --git a/src/plugins/mesonprojectmanager/project/mesonprocess.cpp b/src/plugins/mesonprojectmanager/project/mesonprocess.cpp index 82ec6e55e4d..e457a9c379b 100644 --- a/src/plugins/mesonprojectmanager/project/mesonprocess.cpp +++ b/src/plugins/mesonprojectmanager/project/mesonprocess.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/src/plugins/mesonprojectmanager/project/mesonprocess.h b/src/plugins/mesonprojectmanager/project/mesonprocess.h index 9c5c6db9a97..f4c191af933 100644 --- a/src/plugins/mesonprojectmanager/project/mesonprocess.h +++ b/src/plugins/mesonprojectmanager/project/mesonprocess.h @@ -27,9 +27,6 @@ #include "exewrappers/mesonwrapper.h" -#include - -#include #include #include #include @@ -39,6 +36,8 @@ #include +namespace Utils { class QtcProcess; } + namespace MesonProjectManager { namespace Internal { diff --git a/src/plugins/perfprofiler/perfconfigwidget.cpp b/src/plugins/perfprofiler/perfconfigwidget.cpp index c5aacbacbdf..97d5ed752de 100644 --- a/src/plugins/perfprofiler/perfconfigwidget.cpp +++ b/src/plugins/perfprofiler/perfconfigwidget.cpp @@ -29,7 +29,6 @@ #include -#include #include #include #include @@ -43,7 +42,9 @@ #include #include #include +#include #include +#include using namespace Utils; @@ -124,6 +125,8 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent) }.attachTo(this); } +PerfConfigWidget::~PerfConfigWidget() = default; + void PerfConfigWidget::setTarget(ProjectExplorer::Target *target) { ProjectExplorer::IDevice::ConstPtr device; @@ -146,10 +149,10 @@ void PerfConfigWidget::setTarget(ProjectExplorer::Target *target) return; } - connect(m_process.get(), &ProjectExplorer::DeviceProcess::finished, + connect(m_process.get(), &QtcProcess::finished, this, &PerfConfigWidget::handleProcessFinished); - connect(m_process.get(), &ProjectExplorer::DeviceProcess::errorOccurred, + connect(m_process.get(), &QtcProcess::errorOccurred, this, &PerfConfigWidget::handleProcessError); useTracePointsButton->setEnabled(true); diff --git a/src/plugins/perfprofiler/perfconfigwidget.h b/src/plugins/perfprofiler/perfconfigwidget.h index bb4795a7910..4f6c5c5602b 100644 --- a/src/plugins/perfprofiler/perfconfigwidget.h +++ b/src/plugins/perfprofiler/perfconfigwidget.h @@ -29,10 +29,14 @@ #include -#include +#include -#include -#include +QT_BEGIN_NAMESPACE +class QPushButton; +class QTableView; +QT_END_NAMESPACE + +namespace Utils { class QtcProcess; } namespace PerfProfiler { namespace Internal { @@ -42,6 +46,7 @@ class PerfConfigWidget : public Core::IOptionsPageWidget Q_OBJECT public: explicit PerfConfigWidget(PerfSettings *settings, QWidget *parent = nullptr); + ~PerfConfigWidget(); void updateUi(); void setTarget(ProjectExplorer::Target *target); @@ -55,7 +60,7 @@ private: void handleProcessError(QProcess::ProcessError error); PerfSettings *m_settings; - std::unique_ptr m_process; + std::unique_ptr m_process; QTableView *eventsView; QPushButton *useTracePointsButton; diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index edd445d8056..f638d14c903 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -131,9 +130,9 @@ public: return; } - connect(m_process, &DeviceProcess::started, this, &RunWorker::reportStarted); - connect(m_process, &DeviceProcess::finished, this, &RunWorker::reportStopped); - connect(m_process, &DeviceProcess::errorOccurred, [this](QProcess::ProcessError e) { + connect(m_process, &QtcProcess::started, this, &RunWorker::reportStarted); + connect(m_process, &QtcProcess::finished, this, &RunWorker::reportStopped); + connect(m_process, &QtcProcess::errorOccurred, [this](QProcess::ProcessError e) { // The terminate() below will frequently lead to QProcess::Crashed. We're not interested // in that. FailedToStart is the only actual failure. if (e == QProcess::FailedToStart) { @@ -162,10 +161,10 @@ public: m_process->terminate(); } - DeviceProcess *recorder() { return m_process; } + QtcProcess *recorder() { return m_process; } private: - QPointer m_process; + QPointer m_process; QStringList m_perfRecordArguments; }; @@ -214,12 +213,12 @@ void PerfProfilerRunner::start() PerfDataReader *reader = m_perfParserWorker->reader(); if (auto prw = qobject_cast(m_perfRecordWorker)) { // That's the local case. - DeviceProcess *recorder = prw->recorder(); - connect(recorder, &DeviceProcess::readyReadStandardError, this, [this, recorder] { + QtcProcess *recorder = prw->recorder(); + connect(recorder, &QtcProcess::readyReadStandardError, this, [this, recorder] { appendMessage(QString::fromLocal8Bit(recorder->readAllStandardError()), Utils::StdErrFormat); }); - connect(recorder, &DeviceProcess::readyReadStandardOutput, this, [this, reader, recorder] { + connect(recorder, &QtcProcess::readyReadStandardOutput, this, [this, reader, recorder] { if (!reader->feedParser(recorder->readAllStandardOutput())) reportFailure(tr("Failed to transfer Perf data to perfparser.")); }); diff --git a/src/plugins/perfprofiler/perftracepointdialog.cpp b/src/plugins/perfprofiler/perftracepointdialog.cpp index 070b4ccb4c5..3a360c5c974 100644 --- a/src/plugins/perfprofiler/perftracepointdialog.cpp +++ b/src/plugins/perfprofiler/perftracepointdialog.cpp @@ -35,9 +35,8 @@ #include #include +#include -#include -#include #include #include @@ -84,8 +83,8 @@ PerfTracePointDialog::PerfTracePointDialog() : PerfTracePointDialog::~PerfTracePointDialog() { if (m_process && m_process->state() != QProcess::NotRunning) { - DeviceProcess *process = m_process.release(); - connect(process, &DeviceProcess::finished, process, &QObject::deleteLater); + QtcProcess *process = m_process.release(); + connect(process, &QtcProcess::finished, process, &QObject::deleteLater); process->kill(); QTimer::singleShot(10000, process, &QObject::deleteLater); } @@ -108,10 +107,10 @@ void PerfTracePointDialog::runScript() else m_process->setCommand({"sh", {}}); - connect(m_process.get(), &DeviceProcess::finished, + connect(m_process.get(), &QtcProcess::finished, this, &PerfTracePointDialog::handleProcessFinished); - connect(m_process.get(), &DeviceProcess::errorOccurred, + connect(m_process.get(), &QtcProcess::errorOccurred, this, &PerfTracePointDialog::handleProcessError); m_process->start(); diff --git a/src/plugins/perfprofiler/perftracepointdialog.h b/src/plugins/perfprofiler/perftracepointdialog.h index 3d51364321b..94838d59172 100644 --- a/src/plugins/perfprofiler/perftracepointdialog.h +++ b/src/plugins/perfprofiler/perftracepointdialog.h @@ -25,14 +25,10 @@ #pragma once -#include #include #include -#include -#include -#include -#include +#include namespace PerfProfiler { namespace Internal { @@ -55,7 +51,7 @@ private: Ui::PerfTracePointDialog *m_ui; ProjectExplorer::IDevice::ConstPtr m_device; - std::unique_ptr m_process; + std::unique_ptr m_process; void accept() final; void reject() final; diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 6159a2a5599..fbebacf90d3 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -36,7 +36,6 @@ #include #include "devicesupport/desktopdevice.h" -#include "devicesupport/deviceprocess.h" #include "projectexplorer.h" #include "projectexplorersettings.h" #include "runcontrol.h" diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 87efde505e9..39c5c7a7da8 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -97,7 +97,7 @@ DeviceProcessList *DesktopDevice::createProcessListModel(QObject *parent) const return new Internal::LocalProcessList(sharedFromThis(), parent); } -DeviceProcess *DesktopDevice::createProcess(QObject *parent) const +QtcProcess *DesktopDevice::createProcess(QObject *parent) const { return new Internal::DesktopDeviceProcess(sharedFromThis(), parent); } diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 06502c559d6..0454c9c13cb 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -50,7 +50,7 @@ public: DeviceProcessList *createProcessListModel(QObject *parent) const override; bool canCreateProcess() const override { return true; } ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override; - DeviceProcess *createProcess(QObject *parent) const override; + Utils::QtcProcess *createProcess(QObject *parent) const override; DeviceProcessSignalOperation::Ptr signalOperation() const override; DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index ebee22824ca..94e97494478 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -23,7 +23,6 @@ ** ****************************************************************************/ -#include "deviceprocess.h" #include "deviceusedportsgatherer.h" #include @@ -31,6 +30,7 @@ #include #include #include +#include #include #include @@ -44,7 +44,7 @@ namespace Internal { class DeviceUsedPortsGathererPrivate { public: - QPointer process; + QPointer process; QList usedPorts; QByteArray remoteStdout; QByteArray remoteStderr; @@ -77,13 +77,13 @@ void DeviceUsedPortsGatherer::start(const IDevice::ConstPtr &device) const QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol; d->process = d->device->createProcess(this); - connect(d->process.data(), &DeviceProcess::finished, + connect(d->process.data(), &QtcProcess::finished, this, &DeviceUsedPortsGatherer::handleProcessFinished); - connect(d->process.data(), &DeviceProcess::errorOccurred, + connect(d->process.data(), &QtcProcess::errorOccurred, this, &DeviceUsedPortsGatherer::handleProcessError); - connect(d->process.data(), &DeviceProcess::readyReadStandardOutput, + connect(d->process.data(), &QtcProcess::readyReadStandardOutput, this, &DeviceUsedPortsGatherer::handleRemoteStdOut); - connect(d->process.data(), &DeviceProcess::readyReadStandardError, + connect(d->process.data(), &QtcProcess::readyReadStandardError, this, &DeviceUsedPortsGatherer::handleRemoteStdErr); d->process->setCommand(d->portsGatheringMethod->commandLine(protocol)); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 7f1aa6c4482..70b61107635 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -590,7 +590,7 @@ OsType IDevice::osType() const return d->osType; } -DeviceProcess *IDevice::createProcess(QObject * /* parent */) const +QtcProcess *IDevice::createProcess(QObject * /* parent */) const { QTC_CHECK(false); return nullptr; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 0eee1ab8e76..9d724fbd150 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -60,7 +60,6 @@ class QtcProcess; namespace ProjectExplorer { -class DeviceProcess; class DeviceProcessList; class Kit; class Task; @@ -182,7 +181,7 @@ public: virtual DeviceTester *createDeviceTester() const; virtual bool canCreateProcess() const { return false; } - virtual DeviceProcess *createProcess(QObject *parent) const; + virtual Utils::QtcProcess *createProcess(QObject *parent) const; virtual DeviceProcessSignalOperation::Ptr signalOperation() const = 0; virtual DeviceEnvironmentFetcher::Ptr environmentFetcher() const; diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 3734f85574e..9a01263cbd8 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -101,8 +101,8 @@ void QnxDevice::updateVersionNumber() const { QEventLoop eventLoop; SshDeviceProcess versionNumberProcess(sharedFromThis()); - QObject::connect(&versionNumberProcess, &SshDeviceProcess::finished, &eventLoop, &QEventLoop::quit); - QObject::connect(&versionNumberProcess, &DeviceProcess::errorOccurred, &eventLoop, &QEventLoop::quit); + QObject::connect(&versionNumberProcess, &QtcProcess::finished, &eventLoop, &QEventLoop::quit); + QObject::connect(&versionNumberProcess, &QtcProcess::errorOccurred, &eventLoop, &QEventLoop::quit); versionNumberProcess.setCommand({"uname", {"-r"}}); versionNumberProcess.start(); @@ -156,7 +156,7 @@ DeviceTester *QnxDevice::createDeviceTester() const return new QnxDeviceTester; } -DeviceProcess *QnxDevice::createProcess(QObject *parent) const +QtcProcess *QnxDevice::createProcess(QObject *parent) const { return new QnxDeviceProcess(sharedFromThis(), parent); } diff --git a/src/plugins/qnx/qnxdevice.h b/src/plugins/qnx/qnxdevice.h index 7ea275c7428..cd9f91fca6c 100644 --- a/src/plugins/qnx/qnxdevice.h +++ b/src/plugins/qnx/qnxdevice.h @@ -47,7 +47,7 @@ public: ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; ProjectExplorer::DeviceTester *createDeviceTester() const override; - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override; + Utils::QtcProcess *createProcess(QObject *parent) const override; int qnxVersion() const; diff --git a/src/plugins/qnx/slog2inforunner.cpp b/src/plugins/qnx/slog2inforunner.cpp index 75fb31cf014..3abb35d2b2e 100644 --- a/src/plugins/qnx/slog2inforunner.cpp +++ b/src/plugins/qnx/slog2inforunner.cpp @@ -52,15 +52,15 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl) m_applicationId.truncate(63); m_testProcess = new QnxDeviceProcess(device(), this); - connect(m_testProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted); + connect(m_testProcess, &QtcProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted); m_launchDateTimeProcess = new SshDeviceProcess(device(), this); - connect(m_launchDateTimeProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::launchSlog2Info); + connect(m_launchDateTimeProcess, &QtcProcess::finished, this, &Slog2InfoRunner::launchSlog2Info); m_logProcess = new QnxDeviceProcess(device(), this); - connect(m_logProcess, &DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); - connect(m_logProcess, &DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); - connect(m_logProcess, &DeviceProcess::errorOccurred, this, &Slog2InfoRunner::handleLogError); + connect(m_logProcess, &QtcProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); + connect(m_logProcess, &QtcProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); + connect(m_logProcess, &QtcProcess::errorOccurred, this, &Slog2InfoRunner::handleLogError); } void Slog2InfoRunner::printMissingWarning() diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 4c3aa4c7b9a..3caf42288cc 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -317,15 +317,15 @@ LinuxDevice::LinuxDevice() }}); setOpenTerminal([this](const Environment &env, const FilePath &workingDir) { - DeviceProcess * const proc = createProcess(nullptr); - QObject::connect(proc, &DeviceProcess::finished, [proc] { + QtcProcess * const proc = createProcess(nullptr); + QObject::connect(proc, &QtcProcess::finished, [proc] { if (!proc->errorString().isEmpty()) { Core::MessageManager::writeDisrupting( tr("Error running remote shell: %1").arg(proc->errorString())); } proc->deleteLater(); }); - QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] { + QObject::connect(proc, &QtcProcess::errorOccurred, [proc] { Core::MessageManager::writeDisrupting(tr("Error starting remote shell.")); proc->deleteLater(); }); @@ -358,7 +358,7 @@ IDeviceWidget *LinuxDevice::createWidget() return new GenericLinuxDeviceConfigurationWidget(sharedFromThis()); } -DeviceProcess *LinuxDevice::createProcess(QObject *parent) const +QtcProcess *LinuxDevice::createProcess(QObject *parent) const { return new LinuxDeviceProcess(sharedFromThis(), parent); } diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index d2906b230c3..2e55cd5bb85 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -47,7 +47,7 @@ public: ProjectExplorer::IDeviceWidget *createWidget() override; bool canCreateProcess() const override { return true; } - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override; + Utils::QtcProcess *createProcess(QObject *parent) const override; bool canAutoDetectPorts() const override; ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override; bool canCreateProcessModel() const override { return true; } diff --git a/src/plugins/remotelinux/linuxdeviceprocess.cpp b/src/plugins/remotelinux/linuxdeviceprocess.cpp index f3da62a53a9..4b3d2c39e99 100644 --- a/src/plugins/remotelinux/linuxdeviceprocess.cpp +++ b/src/plugins/remotelinux/linuxdeviceprocess.cpp @@ -40,10 +40,10 @@ LinuxDeviceProcess::LinuxDeviceProcess(const QSharedPointer #include #include +#include #include using namespace ProjectExplorer; @@ -54,9 +54,9 @@ void RemoteLinuxEnvironmentReader::start() } m_stop = false; m_deviceProcess = m_device->createProcess(this); - connect(m_deviceProcess, &DeviceProcess::errorOccurred, + connect(m_deviceProcess, &QtcProcess::errorOccurred, this, &RemoteLinuxEnvironmentReader::handleError); - connect(m_deviceProcess, &DeviceProcess::finished, + connect(m_deviceProcess, &QtcProcess::finished, this, &RemoteLinuxEnvironmentReader::remoteProcessFinished); m_deviceProcess->setCommand({"env", {}}); m_deviceProcess->start(); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.h b/src/plugins/remotelinux/remotelinuxenvironmentreader.h index d16664e8708..6f92dcff1a8 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.h @@ -30,8 +30,6 @@ #include -namespace ProjectExplorer { class DeviceProcess; } - namespace RemoteLinux { namespace Internal { @@ -61,7 +59,7 @@ private: bool m_stop = false; Utils::Environment m_env; ProjectExplorer::IDevice::ConstPtr m_device; - ProjectExplorer::DeviceProcess *m_deviceProcess = nullptr; + Utils::QtcProcess *m_deviceProcess = nullptr; }; } // namespace Internal diff --git a/src/plugins/webassembly/webassemblydevice.cpp b/src/plugins/webassembly/webassemblydevice.cpp index ae9fb02ae3e..43d06ae5546 100644 --- a/src/plugins/webassembly/webassemblydevice.cpp +++ b/src/plugins/webassembly/webassemblydevice.cpp @@ -26,7 +26,6 @@ #include "webassemblyconstants.h" #include "webassemblydevice.h" -#include #include using namespace ProjectExplorer;