Introduce processImplHook

Call new hook from inside QtcProcess::start().
This hook calls new virtual method
IDevice::createProcessInterface().
That's all what should be needed from device
to setup properly device specific process.

Make QtcProcess::createProcessInterface() private now.

Change-Id: I2136698063bafc846ebc2d3db6cc11376902eff0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-02-21 12:49:14 +01:00
parent d979bd8da9
commit fd7bf831ba
5 changed files with 33 additions and 6 deletions

View File

@@ -56,8 +56,6 @@ public:
QtcProcess(QObject *parent = nullptr);
~QtcProcess();
void setProcessInterface(ProcessInterface *interface);
// ProcessInterface related
void start() override;
@@ -215,6 +213,8 @@ public:
QString toStandaloneCommandLine() const;
private:
void setProcessInterface(ProcessInterface *interface);
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const QtcProcess &r);
friend class Internal::QtcProcessPrivate;
@@ -229,6 +229,8 @@ private:
class DeviceProcessHooks
{
public:
std::function<ProcessInterface *(const FilePath &)> processImplHook;
// TODO: remove this hook
std::function<void(QtcProcess &)> startProcessHook;
std::function<Environment(const FilePath &)> systemEnvironmentForBinary;
};