forked from qt-creator/qt-creator
DeviceShell: Merge done() and errorOccurred() signals into one
Don't connect to QtcProcess::errorOccurred() signal, as it's going to be removed soon. Rely on done() signal instead. Change-Id: I28260f8eb77911a23de80512881cf7220f1bc1fc Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -277,8 +277,8 @@ void DeviceShell::startupFailed(const CommandLine &cmdLine)
|
|||||||
bool DeviceShell::start()
|
bool DeviceShell::start()
|
||||||
{
|
{
|
||||||
m_shellProcess = new QtcProcess();
|
m_shellProcess = new QtcProcess();
|
||||||
connect(m_shellProcess, &QtcProcess::done, this, [this] { emit done(); });
|
connect(m_shellProcess, &QtcProcess::done, m_shellProcess,
|
||||||
connect(m_shellProcess, &QtcProcess::errorOccurred, this, &DeviceShell::errorOccurred);
|
[this] { emit done(m_shellProcess->resultData()); });
|
||||||
connect(m_shellProcess, &QObject::destroyed, this, [this] { m_shellProcess = nullptr; });
|
connect(m_shellProcess, &QObject::destroyed, this, [this] { m_shellProcess = nullptr; });
|
||||||
connect(&m_thread, &QThread::finished, m_shellProcess, [this] { closeShellProcess(); });
|
connect(&m_thread, &QThread::finished, m_shellProcess, [this] { closeShellProcess(); });
|
||||||
|
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class CommandLine;
|
class CommandLine;
|
||||||
|
class ProcessResultData;
|
||||||
class QtcProcess;
|
class QtcProcess;
|
||||||
|
|
||||||
class DeviceShellImpl;
|
class DeviceShellImpl;
|
||||||
@@ -69,8 +70,7 @@ public:
|
|||||||
State state() const;
|
State state() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void done();
|
void done(const ProcessResultData &resultData);
|
||||||
void errorOccurred(QProcess::ProcessError error);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void startupFailed(const CommandLine &cmdLine);
|
virtual void startupFailed(const CommandLine &cmdLine);
|
||||||
|
@@ -450,8 +450,11 @@ void DockerDevicePrivate::startContainer()
|
|||||||
LOG("Container via process: " << m_container);
|
LOG("Container via process: " << m_container);
|
||||||
|
|
||||||
m_shell = std::make_unique<ContainerShell>(m_container);
|
m_shell = std::make_unique<ContainerShell>(m_container);
|
||||||
connect(m_shell.get(), &DeviceShell::errorOccurred, this, [this] (QProcess::ProcessError error) {
|
connect(m_shell.get(), &DeviceShell::done, this, [this] (const ProcessResultData &resultData) {
|
||||||
qCWarning(dockerDeviceLog) << "Container shell encountered error:" << error;
|
if (resultData.m_error != QProcess::UnknownError)
|
||||||
|
return;
|
||||||
|
|
||||||
|
qCWarning(dockerDeviceLog) << "Container shell encountered error:" << resultData.m_error;
|
||||||
m_shell.reset();
|
m_shell.reset();
|
||||||
|
|
||||||
DockerApi::recheckDockerDaemon();
|
DockerApi::recheckDockerDaemon();
|
||||||
|
Reference in New Issue
Block a user