forked from qt-creator/qt-creator
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 <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -167,7 +167,7 @@ ProjectExplorer::IDeviceWidget *QdbDevice::createWidget()
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeviceProcess *QdbDevice::createProcess(QObject *parent) const
|
QtcProcess *QdbDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new QdbDeviceProcess(sharedFromThis(), parent);
|
return new QdbDeviceProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::IDeviceWidget *createWidget() final;
|
ProjectExplorer::IDeviceWidget *createWidget() final;
|
||||||
|
|
||||||
ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const final;
|
Utils::QtcProcess *createProcess(QObject *parent) const final;
|
||||||
|
|
||||||
void setSerialNumber(const QString &serial);
|
void setSerialNumber(const QString &serial);
|
||||||
QString serialNumber() const;
|
QString serialNumber() const;
|
||||||
|
|||||||
@@ -54,7 +54,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
|
|||||||
@@ -121,10 +121,10 @@ void DockerDeviceProcess::start()
|
|||||||
DockerDevice::ConstPtr dockerDevice = qSharedPointerCast<const DockerDevice>(device());
|
DockerDevice::ConstPtr dockerDevice = qSharedPointerCast<const DockerDevice>(device());
|
||||||
QTC_ASSERT(dockerDevice, return);
|
QTC_ASSERT(dockerDevice, return);
|
||||||
|
|
||||||
connect(this, &DeviceProcess::readyReadStandardOutput, this, [this] {
|
connect(this, &QtcProcess::readyReadStandardOutput, this, [this] {
|
||||||
MessageManager::writeSilently(QString::fromLocal8Bit(readAllStandardError()));
|
MessageManager::writeSilently(QString::fromLocal8Bit(readAllStandardError()));
|
||||||
});
|
});
|
||||||
connect(this, &DeviceProcess::readyReadStandardError, this, [this] {
|
connect(this, &QtcProcess::readyReadStandardError, this, [this] {
|
||||||
MessageManager::writeDisrupting(QString::fromLocal8Bit(readAllStandardError()));
|
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, &QtcProcess::finished, proc, &QObject::deleteLater);
|
||||||
|
|
||||||
QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] {
|
QObject::connect(proc, &QtcProcess::errorOccurred, [proc] {
|
||||||
MessageManager::writeDisrupting(tr("Error starting remote shell."));
|
MessageManager::writeDisrupting(tr("Error starting remote shell."));
|
||||||
proc->deleteLater();
|
proc->deleteLater();
|
||||||
});
|
});
|
||||||
@@ -938,7 +938,7 @@ QVariantMap DockerDevice::toMap() const
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *DockerDevice::createProcess(QObject *parent) const
|
QtcProcess *DockerDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new DockerDeviceProcess(sharedFromThis(), parent);
|
return new DockerDeviceProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public:
|
|||||||
QList<ProjectExplorer::Task> validate() const override;
|
QList<ProjectExplorer::Task> validate() const override;
|
||||||
|
|
||||||
bool canCreateProcess() const override { return true; }
|
bool canCreateProcess() const override { return true; }
|
||||||
ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override;
|
Utils::QtcProcess *createProcess(QObject *parent) const override;
|
||||||
bool canAutoDetectPorts() const override;
|
bool canAutoDetectPorts() const override;
|
||||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
||||||
bool canCreateProcessModel() const override { return false; }
|
bool canCreateProcessModel() const override { return false; }
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "mcusupportdevice.h"
|
#include "mcusupportdevice.h"
|
||||||
#include "mcusupportconstants.h"
|
#include "mcusupportconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
|||||||
@@ -27,9 +27,6 @@
|
|||||||
|
|
||||||
#include "exewrappers/mesonwrapper.h"
|
#include "exewrappers/mesonwrapper.h"
|
||||||
|
|
||||||
#include <utils/qtcprocess.h>
|
|
||||||
|
|
||||||
#include <QBuffer>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
@@ -39,6 +36,8 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
namespace Utils { class QtcProcess; }
|
||||||
|
|
||||||
namespace MesonProjectManager {
|
namespace MesonProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
@@ -43,7 +42,9 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
#include <QTableView>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -124,6 +125,8 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
|
|||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PerfConfigWidget::~PerfConfigWidget() = default;
|
||||||
|
|
||||||
void PerfConfigWidget::setTarget(ProjectExplorer::Target *target)
|
void PerfConfigWidget::setTarget(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
ProjectExplorer::IDevice::ConstPtr device;
|
ProjectExplorer::IDevice::ConstPtr device;
|
||||||
@@ -146,10 +149,10 @@ void PerfConfigWidget::setTarget(ProjectExplorer::Target *target)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(m_process.get(), &ProjectExplorer::DeviceProcess::finished,
|
connect(m_process.get(), &QtcProcess::finished,
|
||||||
this, &PerfConfigWidget::handleProcessFinished);
|
this, &PerfConfigWidget::handleProcessFinished);
|
||||||
|
|
||||||
connect(m_process.get(), &ProjectExplorer::DeviceProcess::errorOccurred,
|
connect(m_process.get(), &QtcProcess::errorOccurred,
|
||||||
this, &PerfConfigWidget::handleProcessError);
|
this, &PerfConfigWidget::handleProcessError);
|
||||||
|
|
||||||
useTracePointsButton->setEnabled(true);
|
useTracePointsButton->setEnabled(true);
|
||||||
|
|||||||
@@ -29,10 +29,14 @@
|
|||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
#include <QProcess>
|
||||||
|
|
||||||
#include <QPushButton>
|
QT_BEGIN_NAMESPACE
|
||||||
#include <QTableView>
|
class QPushButton;
|
||||||
|
class QTableView;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Utils { class QtcProcess; }
|
||||||
|
|
||||||
namespace PerfProfiler {
|
namespace PerfProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -42,6 +46,7 @@ class PerfConfigWidget : public Core::IOptionsPageWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PerfConfigWidget(PerfSettings *settings, QWidget *parent = nullptr);
|
explicit PerfConfigWidget(PerfSettings *settings, QWidget *parent = nullptr);
|
||||||
|
~PerfConfigWidget();
|
||||||
|
|
||||||
void updateUi();
|
void updateUi();
|
||||||
void setTarget(ProjectExplorer::Target *target);
|
void setTarget(ProjectExplorer::Target *target);
|
||||||
@@ -55,7 +60,7 @@ private:
|
|||||||
void handleProcessError(QProcess::ProcessError error);
|
void handleProcessError(QProcess::ProcessError error);
|
||||||
|
|
||||||
PerfSettings *m_settings;
|
PerfSettings *m_settings;
|
||||||
std::unique_ptr<ProjectExplorer::DeviceProcess> m_process;
|
std::unique_ptr<Utils::QtcProcess> m_process;
|
||||||
|
|
||||||
QTableView *eventsView;
|
QTableView *eventsView;
|
||||||
QPushButton *useTracePointsButton;
|
QPushButton *useTracePointsButton;
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -131,9 +130,9 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(m_process, &DeviceProcess::started, this, &RunWorker::reportStarted);
|
connect(m_process, &QtcProcess::started, this, &RunWorker::reportStarted);
|
||||||
connect(m_process, &DeviceProcess::finished, this, &RunWorker::reportStopped);
|
connect(m_process, &QtcProcess::finished, this, &RunWorker::reportStopped);
|
||||||
connect(m_process, &DeviceProcess::errorOccurred, [this](QProcess::ProcessError e) {
|
connect(m_process, &QtcProcess::errorOccurred, [this](QProcess::ProcessError e) {
|
||||||
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested
|
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested
|
||||||
// in that. FailedToStart is the only actual failure.
|
// in that. FailedToStart is the only actual failure.
|
||||||
if (e == QProcess::FailedToStart) {
|
if (e == QProcess::FailedToStart) {
|
||||||
@@ -162,10 +161,10 @@ public:
|
|||||||
m_process->terminate();
|
m_process->terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *recorder() { return m_process; }
|
QtcProcess *recorder() { return m_process; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<DeviceProcess> m_process;
|
QPointer<QtcProcess> m_process;
|
||||||
QStringList m_perfRecordArguments;
|
QStringList m_perfRecordArguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -214,12 +213,12 @@ void PerfProfilerRunner::start()
|
|||||||
PerfDataReader *reader = m_perfParserWorker->reader();
|
PerfDataReader *reader = m_perfParserWorker->reader();
|
||||||
if (auto prw = qobject_cast<LocalPerfRecordWorker *>(m_perfRecordWorker)) {
|
if (auto prw = qobject_cast<LocalPerfRecordWorker *>(m_perfRecordWorker)) {
|
||||||
// That's the local case.
|
// That's the local case.
|
||||||
DeviceProcess *recorder = prw->recorder();
|
QtcProcess *recorder = prw->recorder();
|
||||||
connect(recorder, &DeviceProcess::readyReadStandardError, this, [this, recorder] {
|
connect(recorder, &QtcProcess::readyReadStandardError, this, [this, recorder] {
|
||||||
appendMessage(QString::fromLocal8Bit(recorder->readAllStandardError()),
|
appendMessage(QString::fromLocal8Bit(recorder->readAllStandardError()),
|
||||||
Utils::StdErrFormat);
|
Utils::StdErrFormat);
|
||||||
});
|
});
|
||||||
connect(recorder, &DeviceProcess::readyReadStandardOutput, this, [this, reader, recorder] {
|
connect(recorder, &QtcProcess::readyReadStandardOutput, this, [this, reader, recorder] {
|
||||||
if (!reader->feedParser(recorder->readAllStandardOutput()))
|
if (!reader->feedParser(recorder->readAllStandardOutput()))
|
||||||
reportFailure(tr("Failed to transfer Perf data to perfparser."));
|
reportFailure(tr("Failed to transfer Perf data to perfparser."));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,9 +35,8 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@@ -84,8 +83,8 @@ PerfTracePointDialog::PerfTracePointDialog() :
|
|||||||
PerfTracePointDialog::~PerfTracePointDialog()
|
PerfTracePointDialog::~PerfTracePointDialog()
|
||||||
{
|
{
|
||||||
if (m_process && m_process->state() != QProcess::NotRunning) {
|
if (m_process && m_process->state() != QProcess::NotRunning) {
|
||||||
DeviceProcess *process = m_process.release();
|
QtcProcess *process = m_process.release();
|
||||||
connect(process, &DeviceProcess::finished, process, &QObject::deleteLater);
|
connect(process, &QtcProcess::finished, process, &QObject::deleteLater);
|
||||||
process->kill();
|
process->kill();
|
||||||
QTimer::singleShot(10000, process, &QObject::deleteLater);
|
QTimer::singleShot(10000, process, &QObject::deleteLater);
|
||||||
}
|
}
|
||||||
@@ -108,10 +107,10 @@ void PerfTracePointDialog::runScript()
|
|||||||
else
|
else
|
||||||
m_process->setCommand({"sh", {}});
|
m_process->setCommand({"sh", {}});
|
||||||
|
|
||||||
connect(m_process.get(), &DeviceProcess::finished,
|
connect(m_process.get(), &QtcProcess::finished,
|
||||||
this, &PerfTracePointDialog::handleProcessFinished);
|
this, &PerfTracePointDialog::handleProcessFinished);
|
||||||
|
|
||||||
connect(m_process.get(), &DeviceProcess::errorOccurred,
|
connect(m_process.get(), &QtcProcess::errorOccurred,
|
||||||
this, &PerfTracePointDialog::handleProcessError);
|
this, &PerfTracePointDialog::handleProcessError);
|
||||||
|
|
||||||
m_process->start();
|
m_process->start();
|
||||||
|
|||||||
@@ -25,14 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QTextEdit>
|
#include <QProcess>
|
||||||
#include <QLabel>
|
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QComboBox>
|
|
||||||
|
|
||||||
namespace PerfProfiler {
|
namespace PerfProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -55,7 +51,7 @@ private:
|
|||||||
|
|
||||||
Ui::PerfTracePointDialog *m_ui;
|
Ui::PerfTracePointDialog *m_ui;
|
||||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||||
std::unique_ptr<ProjectExplorer::DeviceProcess> m_process;
|
std::unique_ptr<Utils::QtcProcess> m_process;
|
||||||
|
|
||||||
void accept() final;
|
void accept() final;
|
||||||
void reject() final;
|
void reject() final;
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include "devicesupport/desktopdevice.h"
|
#include "devicesupport/desktopdevice.h"
|
||||||
#include "devicesupport/deviceprocess.h"
|
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
#include "runcontrol.h"
|
#include "runcontrol.h"
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ DeviceProcessList *DesktopDevice::createProcessListModel(QObject *parent) const
|
|||||||
return new Internal::LocalProcessList(sharedFromThis(), parent);
|
return new Internal::LocalProcessList(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *DesktopDevice::createProcess(QObject *parent) const
|
QtcProcess *DesktopDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new Internal::DesktopDeviceProcess(sharedFromThis(), parent);
|
return new Internal::DesktopDeviceProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
DeviceProcessList *createProcessListModel(QObject *parent) const override;
|
DeviceProcessList *createProcessListModel(QObject *parent) const override;
|
||||||
bool canCreateProcess() const override { return true; }
|
bool canCreateProcess() const override { return true; }
|
||||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
||||||
DeviceProcess *createProcess(QObject *parent) const override;
|
Utils::QtcProcess *createProcess(QObject *parent) const override;
|
||||||
DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
||||||
DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
|
DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
|
||||||
QUrl toolControlChannel(const ControlChannelHint &) const override;
|
QUrl toolControlChannel(const ControlChannelHint &) const override;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "deviceprocess.h"
|
|
||||||
#include "deviceusedportsgatherer.h"
|
#include "deviceusedportsgatherer.h"
|
||||||
|
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
@@ -31,6 +30,7 @@
|
|||||||
#include <utils/port.h>
|
#include <utils/port.h>
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/url.h>
|
#include <utils/url.h>
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
@@ -44,7 +44,7 @@ namespace Internal {
|
|||||||
class DeviceUsedPortsGathererPrivate
|
class DeviceUsedPortsGathererPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QPointer<DeviceProcess> process;
|
QPointer<QtcProcess> process;
|
||||||
QList<Port> usedPorts;
|
QList<Port> usedPorts;
|
||||||
QByteArray remoteStdout;
|
QByteArray remoteStdout;
|
||||||
QByteArray remoteStderr;
|
QByteArray remoteStderr;
|
||||||
@@ -77,13 +77,13 @@ void DeviceUsedPortsGatherer::start(const IDevice::ConstPtr &device)
|
|||||||
const QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol;
|
const QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol;
|
||||||
d->process = d->device->createProcess(this);
|
d->process = d->device->createProcess(this);
|
||||||
|
|
||||||
connect(d->process.data(), &DeviceProcess::finished,
|
connect(d->process.data(), &QtcProcess::finished,
|
||||||
this, &DeviceUsedPortsGatherer::handleProcessFinished);
|
this, &DeviceUsedPortsGatherer::handleProcessFinished);
|
||||||
connect(d->process.data(), &DeviceProcess::errorOccurred,
|
connect(d->process.data(), &QtcProcess::errorOccurred,
|
||||||
this, &DeviceUsedPortsGatherer::handleProcessError);
|
this, &DeviceUsedPortsGatherer::handleProcessError);
|
||||||
connect(d->process.data(), &DeviceProcess::readyReadStandardOutput,
|
connect(d->process.data(), &QtcProcess::readyReadStandardOutput,
|
||||||
this, &DeviceUsedPortsGatherer::handleRemoteStdOut);
|
this, &DeviceUsedPortsGatherer::handleRemoteStdOut);
|
||||||
connect(d->process.data(), &DeviceProcess::readyReadStandardError,
|
connect(d->process.data(), &QtcProcess::readyReadStandardError,
|
||||||
this, &DeviceUsedPortsGatherer::handleRemoteStdErr);
|
this, &DeviceUsedPortsGatherer::handleRemoteStdErr);
|
||||||
|
|
||||||
d->process->setCommand(d->portsGatheringMethod->commandLine(protocol));
|
d->process->setCommand(d->portsGatheringMethod->commandLine(protocol));
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ OsType IDevice::osType() const
|
|||||||
return d->osType;
|
return d->osType;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *IDevice::createProcess(QObject * /* parent */) const
|
QtcProcess *IDevice::createProcess(QObject * /* parent */) const
|
||||||
{
|
{
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ class QtcProcess;
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class DeviceProcess;
|
|
||||||
class DeviceProcessList;
|
class DeviceProcessList;
|
||||||
class Kit;
|
class Kit;
|
||||||
class Task;
|
class Task;
|
||||||
@@ -182,7 +181,7 @@ public:
|
|||||||
virtual DeviceTester *createDeviceTester() const;
|
virtual DeviceTester *createDeviceTester() const;
|
||||||
|
|
||||||
virtual bool canCreateProcess() const { return false; }
|
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 DeviceProcessSignalOperation::Ptr signalOperation() const = 0;
|
||||||
virtual DeviceEnvironmentFetcher::Ptr environmentFetcher() const;
|
virtual DeviceEnvironmentFetcher::Ptr environmentFetcher() const;
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ void QnxDevice::updateVersionNumber() const
|
|||||||
{
|
{
|
||||||
QEventLoop eventLoop;
|
QEventLoop eventLoop;
|
||||||
SshDeviceProcess versionNumberProcess(sharedFromThis());
|
SshDeviceProcess versionNumberProcess(sharedFromThis());
|
||||||
QObject::connect(&versionNumberProcess, &SshDeviceProcess::finished, &eventLoop, &QEventLoop::quit);
|
QObject::connect(&versionNumberProcess, &QtcProcess::finished, &eventLoop, &QEventLoop::quit);
|
||||||
QObject::connect(&versionNumberProcess, &DeviceProcess::errorOccurred, &eventLoop, &QEventLoop::quit);
|
QObject::connect(&versionNumberProcess, &QtcProcess::errorOccurred, &eventLoop, &QEventLoop::quit);
|
||||||
|
|
||||||
versionNumberProcess.setCommand({"uname", {"-r"}});
|
versionNumberProcess.setCommand({"uname", {"-r"}});
|
||||||
versionNumberProcess.start();
|
versionNumberProcess.start();
|
||||||
@@ -156,7 +156,7 @@ DeviceTester *QnxDevice::createDeviceTester() const
|
|||||||
return new QnxDeviceTester;
|
return new QnxDeviceTester;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *QnxDevice::createProcess(QObject *parent) const
|
QtcProcess *QnxDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new QnxDeviceProcess(sharedFromThis(), parent);
|
return new QnxDeviceProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
||||||
|
|
||||||
ProjectExplorer::DeviceTester *createDeviceTester() const override;
|
ProjectExplorer::DeviceTester *createDeviceTester() const override;
|
||||||
ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override;
|
Utils::QtcProcess *createProcess(QObject *parent) const override;
|
||||||
|
|
||||||
int qnxVersion() const;
|
int qnxVersion() const;
|
||||||
|
|
||||||
|
|||||||
@@ -52,15 +52,15 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
|
|||||||
m_applicationId.truncate(63);
|
m_applicationId.truncate(63);
|
||||||
|
|
||||||
m_testProcess = new QnxDeviceProcess(device(), this);
|
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);
|
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);
|
m_logProcess = new QnxDeviceProcess(device(), this);
|
||||||
connect(m_logProcess, &DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput);
|
connect(m_logProcess, &QtcProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput);
|
||||||
connect(m_logProcess, &DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError);
|
connect(m_logProcess, &QtcProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError);
|
||||||
connect(m_logProcess, &DeviceProcess::errorOccurred, this, &Slog2InfoRunner::handleLogError);
|
connect(m_logProcess, &QtcProcess::errorOccurred, this, &Slog2InfoRunner::handleLogError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Slog2InfoRunner::printMissingWarning()
|
void Slog2InfoRunner::printMissingWarning()
|
||||||
|
|||||||
@@ -317,15 +317,15 @@ LinuxDevice::LinuxDevice()
|
|||||||
}});
|
}});
|
||||||
|
|
||||||
setOpenTerminal([this](const Environment &env, const FilePath &workingDir) {
|
setOpenTerminal([this](const Environment &env, const FilePath &workingDir) {
|
||||||
DeviceProcess * const proc = createProcess(nullptr);
|
QtcProcess * const proc = createProcess(nullptr);
|
||||||
QObject::connect(proc, &DeviceProcess::finished, [proc] {
|
QObject::connect(proc, &QtcProcess::finished, [proc] {
|
||||||
if (!proc->errorString().isEmpty()) {
|
if (!proc->errorString().isEmpty()) {
|
||||||
Core::MessageManager::writeDisrupting(
|
Core::MessageManager::writeDisrupting(
|
||||||
tr("Error running remote shell: %1").arg(proc->errorString()));
|
tr("Error running remote shell: %1").arg(proc->errorString()));
|
||||||
}
|
}
|
||||||
proc->deleteLater();
|
proc->deleteLater();
|
||||||
});
|
});
|
||||||
QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] {
|
QObject::connect(proc, &QtcProcess::errorOccurred, [proc] {
|
||||||
Core::MessageManager::writeDisrupting(tr("Error starting remote shell."));
|
Core::MessageManager::writeDisrupting(tr("Error starting remote shell."));
|
||||||
proc->deleteLater();
|
proc->deleteLater();
|
||||||
});
|
});
|
||||||
@@ -358,7 +358,7 @@ IDeviceWidget *LinuxDevice::createWidget()
|
|||||||
return new GenericLinuxDeviceConfigurationWidget(sharedFromThis());
|
return new GenericLinuxDeviceConfigurationWidget(sharedFromThis());
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProcess *LinuxDevice::createProcess(QObject *parent) const
|
QtcProcess *LinuxDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new LinuxDeviceProcess(sharedFromThis(), parent);
|
return new LinuxDeviceProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
ProjectExplorer::IDeviceWidget *createWidget() override;
|
ProjectExplorer::IDeviceWidget *createWidget() override;
|
||||||
|
|
||||||
bool canCreateProcess() const override { return true; }
|
bool canCreateProcess() const override { return true; }
|
||||||
ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override;
|
Utils::QtcProcess *createProcess(QObject *parent) const override;
|
||||||
bool canAutoDetectPorts() const override;
|
bool canAutoDetectPorts() const override;
|
||||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override;
|
||||||
bool canCreateProcessModel() const override { return true; }
|
bool canCreateProcessModel() const override { return true; }
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ LinuxDeviceProcess::LinuxDeviceProcess(const QSharedPointer<const ProjectExplore
|
|||||||
QObject *parent)
|
QObject *parent)
|
||||||
: ProjectExplorer::SshDeviceProcess(device, parent)
|
: ProjectExplorer::SshDeviceProcess(device, parent)
|
||||||
{
|
{
|
||||||
connect(this, &DeviceProcess::finished, this, [this]() {
|
connect(this, &QtcProcess::finished, this, [this]() {
|
||||||
m_processId = 0;
|
m_processId = 0;
|
||||||
});
|
});
|
||||||
connect(this, &DeviceProcess::started, this, [this]() {
|
connect(this, &QtcProcess::started, this, [this]() {
|
||||||
m_pidParsed = false;
|
m_pidParsed = false;
|
||||||
m_output.clear();
|
m_output.clear();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
#include "remotelinuxenvironmentreader.h"
|
#include "remotelinuxenvironmentreader.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
|
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -54,9 +54,9 @@ void RemoteLinuxEnvironmentReader::start()
|
|||||||
}
|
}
|
||||||
m_stop = false;
|
m_stop = false;
|
||||||
m_deviceProcess = m_device->createProcess(this);
|
m_deviceProcess = m_device->createProcess(this);
|
||||||
connect(m_deviceProcess, &DeviceProcess::errorOccurred,
|
connect(m_deviceProcess, &QtcProcess::errorOccurred,
|
||||||
this, &RemoteLinuxEnvironmentReader::handleError);
|
this, &RemoteLinuxEnvironmentReader::handleError);
|
||||||
connect(m_deviceProcess, &DeviceProcess::finished,
|
connect(m_deviceProcess, &QtcProcess::finished,
|
||||||
this, &RemoteLinuxEnvironmentReader::remoteProcessFinished);
|
this, &RemoteLinuxEnvironmentReader::remoteProcessFinished);
|
||||||
m_deviceProcess->setCommand({"env", {}});
|
m_deviceProcess->setCommand({"env", {}});
|
||||||
m_deviceProcess->start();
|
m_deviceProcess->start();
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace ProjectExplorer { class DeviceProcess; }
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -61,7 +59,7 @@ private:
|
|||||||
bool m_stop = false;
|
bool m_stop = false;
|
||||||
Utils::Environment m_env;
|
Utils::Environment m_env;
|
||||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||||
ProjectExplorer::DeviceProcess *m_deviceProcess = nullptr;
|
Utils::QtcProcess *m_deviceProcess = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblydevice.h"
|
#include "webassemblydevice.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocess.h>
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|||||||
Reference in New Issue
Block a user