The m_process member is strictly speaking only needed for processes
handled "fully locally", i.e. without diversion through any device.
Better set it only when needed, even if only to avoid even unused
locally illegal paths like "docker://123/tmp/x" as working directory.
Change-Id: Ia9e686855ff0c213eb3be03def8c4cecc7ee37ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Complains about template argument (QString) and type of value
(const QString) not being the same.
make_optional is usually used with template parameter deduction anyhow,
but in this case we can just return the value.
Change-Id: Icc5c6bb4505d09ab6a864fb7a7c6ec97e34b42b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
And drop the function from the QtcProcess interface, as this was the
only user.
Change-Id: I5a21cdaacb3f91f78058e80cbe1cb1572e9bf331
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Some functions do not work and should therefore not be used.
Line-based processing of the output interferes with the internal
automatic usage of the ChannelBuffers.
Remove the respective functions and move the line parsing over
to the client.
Change-Id: Iaaa58c181e35e132fae863ddb808547142c99221
Reviewed-by: hjk <hjk@qt.io>
To make clear that this is not just any finish.
Also change FinishedError to FinishedWithError, to create
symmetry.
Also adapt enum member description to reality.
Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... and add a QtcProcess::systemEnvironmentForBinary(filePath)
redirecting to IDevice::systemEnvironment() of the device implicitly
given by filePath. A device implied by e.g. a qmake binary or a compiler
binary is a common scenario.
Change-Id: Ieb2c724ae66f1a1752132e4e4648a604390ca369
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Make functionality dependent on an (intentionally ugly)
setProcessUserEventWhileRunning call.
Also, back-paddle a bit on API combination of QtcProcess and
SynchronousPrceoss for now and prevent the QtcProcess-and-
runBlocking and SynchronousProcess-and-start combinations.
Goal is still to have all in QtcProcess in the end, but this
may take a while.
Change-Id: Ic146ec5db0ab8dc9613e5b2af5f4dc90bc7465ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The PCH header is undefining CALLBACK after loading Windows headers,
but we need to add it back when using Windows headers that need it.
The new definition needs only to be done when the PCH is used,
otherwise it could lead to re-definition warnings.
Amends 7880950eca
Change-Id: Iae57ac4bbbfdd45b5f9b50a2242103bec6eea5bc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Makes run() more similar to what start() looks like.
Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.
Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Move the remnaining two members into QtcProcessPrivate, its
only user.
Change-Id: I8e0c23e1a56b36b750b5b4bd4e88d762260e42a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The data was present in the ChannelBuffer
Change-Id: Ica645ba58bb2e86d0ef4cf5387f0a228f132e07d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This was requiring parameters the process object already knows.
This is a slight behavior change in most cases, it now includes
always the command line arguments, which previously only happened
in gcctoolchain.cpp and iarewtoolchain.cpp.
Change-Id: Id25a68c397e2f1d8bf52ab29210e215b1de46c6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.
The result bits are now also accessible individually.
There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.
Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.
Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
Instead, make its behavior implicit if none is given.
Change-Id: I3c1a054751a0afe22d0f40a2fed6dd00b5aef205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This reverts a bit of fe8fbf1a4a which was over-shooting API-wise.
Change-Id: Iac4c2b9fa550f7ec0b0aa8deea8c3fc6b6ddcfba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
There's not much interaction between ProcessArgs and QtcProcess
and both .cpp are still quite big, with non-trivial bits.
Change-Id: Id84202f6c34057bf87cc8f27fbb45f78f105e9a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface
So move these items out of QtcProcess, later potentially to a separate
file pair.
Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Merge the pimpls, move the remaining functions to the base.
This leaves SynchronousProcess as a QtcProcess with an internal
special setup. Plan is still to unify this completely.
Change-Id: Ie95d35ace23a1b7e078174ea37b9fd70a3ebe178
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This is the last intermediate step before unification to keep the
merge small.
Change-Id: I5b320f9db4c467c49a384f665cea5e16bfef4f60
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Mechanical to prepare merging the actual classes.
Adapting #includes.
Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Effectively only a single flag controlling a call to setsid().
Change-Id: I6a2be35df1bddc81702575678ee3a065a71cecf5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Copy for now, original will vanish once all is ported.
Idea is still to reduce the number of process related classes.
To avoid a new dependency for qmlpuppet, handle questions to
the user only inside #ifdef.
Change-Id: Ib1354fc0370a87052b4f9c8460dfcf5d762a6c4e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Clang 12 has added a template parameter as "CALLBACK",
which conflicts with the Windows "CALLBACK" define.
Change-Id: I773899d103dcb1a852b555a1900b2de4acb6d96f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Start using it in Utils::Archive.
The idea is to merge SynchronousProcess into QtcProcess (or avoid its
use) to have fewer classes to make "remote-aware".
Change-Id: Ieb08f6f66eab63fd058b75e3bafa79bfbf140387
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Use it to avoid IDevice interface clutter.
Change-Id: I4a04f04e2c343593d937a402060e56ef94fcabf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Various Windows related issues and issues with additional QML designer
components.
Don't use very generic template definitions if the type has to provide
not so generic base functionality (in this case providing a stream
operator for QDataStream).
Task-number: QTCREATORBUG-24098
Change-Id: Id0729c249d1b81e4e939fdaeb2e02b8a64e7e8f9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Which is compiled against an older Qt version to keep it more
compatible.
Change-Id: Ifee61a524055ca383c83da9f237e50536a3fd0cb
Reviewed-by: hjk <hjk@qt.io>