forked from qt-creator/qt-creator
ProcessInterface: Rename interruptProcess() -> interrupt()
Both functionalities meant to do the same. Change-Id: Idd9373cdb24b7b41f9e4befb09326c339263eeb1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -73,6 +73,7 @@ public:
|
||||
ProcessInterface(ProcessSetupData::Ptr setup) : m_setup(setup) {}
|
||||
|
||||
virtual void start() = 0;
|
||||
virtual void interrupt() = 0;
|
||||
virtual void terminate() = 0;
|
||||
virtual void kill() = 0;
|
||||
virtual void close() = 0;
|
||||
@@ -95,7 +96,6 @@ public:
|
||||
virtual bool waitForFinished(int msecs) = 0;
|
||||
|
||||
virtual void kickoffProcess();
|
||||
virtual void interruptProcess();
|
||||
virtual qint64 applicationMainThreadID() const;
|
||||
|
||||
signals:
|
||||
@@ -131,6 +131,7 @@ public:
|
||||
}
|
||||
|
||||
void start() override { m_target->start(); }
|
||||
void interrupt() override { m_target->interrupt(); };
|
||||
void terminate() override { m_target->terminate(); }
|
||||
void kill() override { m_target->kill(); }
|
||||
void close() override { m_target->close(); }
|
||||
@@ -153,7 +154,6 @@ public:
|
||||
bool waitForFinished(int msecs) override { return m_target->waitForFinished(msecs); }
|
||||
|
||||
void kickoffProcess() override { m_target->kickoffProcess(); }
|
||||
void interruptProcess() override { m_target->interruptProcess(); }
|
||||
qint64 applicationMainThreadID() const override { return m_target->applicationMainThreadID(); }
|
||||
|
||||
protected:
|
||||
|
@@ -248,6 +248,7 @@ public:
|
||||
m_terminal.setEnvironment(m_setup->m_environment);
|
||||
m_terminal.start();
|
||||
}
|
||||
void interrupt() override { m_terminal.interrupt(); }
|
||||
void terminate() override { m_terminal.stopProcess(); }
|
||||
void kill() override { m_terminal.stopProcess(); }
|
||||
void close() override { m_terminal.stopProcess(); }
|
||||
@@ -268,7 +269,6 @@ public:
|
||||
bool waitForFinished(int) override { return false; }
|
||||
|
||||
void kickoffProcess() override { m_terminal.kickoffProcess(); }
|
||||
void interruptProcess() override { m_terminal.interruptProcess(); }
|
||||
qint64 applicationMainThreadID() const override { return m_terminal.applicationMainThreadID(); }
|
||||
|
||||
private:
|
||||
@@ -411,6 +411,8 @@ public:
|
||||
QByteArray readAllStandardOutput() override { return m_process->readAllStandardOutput(); }
|
||||
QByteArray readAllStandardError() override { return m_process->readAllStandardError(); }
|
||||
|
||||
void interrupt() override
|
||||
{ QTC_CHECK(false); } // TODO: provide default impl
|
||||
void terminate() override
|
||||
{ m_process->terminate(); }
|
||||
void kill() override
|
||||
@@ -507,6 +509,8 @@ public:
|
||||
QByteArray readAllStandardOutput() override { return m_handle->readAllStandardOutput(); }
|
||||
QByteArray readAllStandardError() override { return m_handle->readAllStandardError(); }
|
||||
|
||||
void interrupt() override
|
||||
{ QTC_CHECK(false); } // TODO: send it to process launcher and use there a default impl of QProcessImpl
|
||||
void terminate() override { cancel(); } // TODO: what are differences among terminate, kill and close?
|
||||
void kill() override { cancel(); } // TODO: see above
|
||||
void close() override { cancel(); } // TODO: see above
|
||||
@@ -690,11 +694,6 @@ void ProcessInterface::kickoffProcess()
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
void ProcessInterface::interruptProcess()
|
||||
{
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
qint64 ProcessInterface::applicationMainThreadID() const
|
||||
{
|
||||
QTC_CHECK(false); return -1;
|
||||
@@ -939,9 +938,12 @@ void QtcProcess::terminate()
|
||||
void QtcProcess::interrupt()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
QTC_ASSERT(d->m_setup->m_useCtrlCStub, return);
|
||||
if (d->m_setup->m_useCtrlCStub)
|
||||
EnumWindows(sendInterruptMessageToAllWindowsOfProcess_enumWnd, processId());
|
||||
else
|
||||
#endif
|
||||
if (d->m_process)
|
||||
d->m_process->interrupt();
|
||||
}
|
||||
|
||||
bool QtcProcess::startDetached(const CommandLine &cmd, const FilePath &workingDirectory, qint64 *pid)
|
||||
@@ -1236,12 +1238,6 @@ void QtcProcess::kickoffProcess()
|
||||
d->m_process->kickoffProcess();
|
||||
}
|
||||
|
||||
void QtcProcess::interruptProcess()
|
||||
{
|
||||
if (d->m_process)
|
||||
d->m_process->interruptProcess();
|
||||
}
|
||||
|
||||
qint64 QtcProcess::applicationMainThreadID() const
|
||||
{
|
||||
if (d->m_process)
|
||||
@@ -1378,7 +1374,6 @@ QString QtcProcess::locateBinary(const QString &binary)
|
||||
return locateBinary(QString::fromLocal8Bit(path), binary);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class Utils::SynchronousProcess
|
||||
|
||||
|
@@ -57,6 +57,7 @@ public:
|
||||
// ProcessInterface related
|
||||
|
||||
void start() override;
|
||||
void interrupt() override;
|
||||
void terminate() override;
|
||||
void kill() override;
|
||||
void close() final;
|
||||
@@ -79,7 +80,6 @@ public:
|
||||
bool waitForFinished(int msecs = 30000) final;
|
||||
|
||||
void kickoffProcess() final;
|
||||
void interruptProcess() final;
|
||||
qint64 applicationMainThreadID() const final;
|
||||
|
||||
// ProcessSetupData related
|
||||
@@ -135,9 +135,6 @@ public:
|
||||
// These (or some of them) may be potentially moved outside of the class.
|
||||
// For some we may aggregate in another public utils class (or subclass of QtcProcess)?
|
||||
|
||||
// TODO: Should it be a part of ProcessInterface, too?
|
||||
virtual void interrupt();
|
||||
|
||||
// TODO: How below 3 methods relate to QtcProcess? Action: move them somewhere else.
|
||||
// Helpers to find binaries. Do not use it for other path variables
|
||||
// and file types.
|
||||
|
@@ -496,7 +496,7 @@ void TerminalProcess::kickoffProcess()
|
||||
#endif
|
||||
}
|
||||
|
||||
void TerminalProcess::interruptProcess()
|
||||
void TerminalProcess::interrupt()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// Not used.
|
||||
|
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
void setAbortOnMetaChars(bool abort); // used only in sshDeviceProcess
|
||||
void kickoffProcess(); // only debugger terminal, only non-windows
|
||||
void interruptProcess(); // only debugger terminal, only non-windows
|
||||
void interrupt(); // only debugger terminal, only non-windows
|
||||
qint64 applicationMainThreadID() const; // only debugger terminal, only windows (-1 otherwise)
|
||||
|
||||
signals:
|
||||
|
@@ -4667,7 +4667,7 @@ void GdbEngine::interruptInferior2()
|
||||
|
||||
} else if (isTermEngine()) {
|
||||
|
||||
terminal()->interruptProcess();
|
||||
terminal()->interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -182,10 +182,10 @@ void TerminalRunner::kickoffProcess()
|
||||
m_stubProc->kickoffProcess();
|
||||
}
|
||||
|
||||
void TerminalRunner::interruptProcess()
|
||||
void TerminalRunner::interrupt()
|
||||
{
|
||||
if (m_stubProc)
|
||||
m_stubProc->interruptProcess();
|
||||
m_stubProc->interrupt();
|
||||
}
|
||||
|
||||
void TerminalRunner::start()
|
||||
|
@@ -78,7 +78,7 @@ public:
|
||||
qint64 applicationMainThreadId() const { return m_applicationMainThreadId; }
|
||||
|
||||
void kickoffProcess();
|
||||
void interruptProcess();
|
||||
void interrupt();
|
||||
|
||||
private:
|
||||
void start() final;
|
||||
|
Reference in New Issue
Block a user