Commit Graph

15 Commits

Author SHA1 Message Date
Jarek Kobus
34f4ec11bd CommandLine: Add a constructor test
Change-Id: I5d5bf8e7f31017f16663103f560e598e2a003d50
Reviewed-by: hjk <hjk@qt.io>
2024-05-16 12:43:11 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
Marcus Tillmanns
dbee11f5b4 Environment: Fix incorrect usage of appendOrSet
appendOrSet will append to existing environment variables which is not
what we want for all the changed locations in this commit.

Change-Id: Icf6b110acc59261659839375672943ec21923da1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-01-26 10:33:34 +00:00
Jarek Kobus
290121bc21 Process: Use more rawStd{Out,Err} const methods instead of mutable ones
Avoid using readAllStandard{Output,Error} mutable methods if possible.
Use non-mutable methods when we are not connected to
readyReadStandard{Output,Error} signals.

Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 17:21:25 +00:00
Marcus Tillmanns
9f5a0e3834 Utils: Fix CommandLine macro expansion
Moves macro expansion before assembling the command line
to correctly quote the resulting arguments on windows.

Change-Id: I62eded9376977ec6095e8648296cd2af53eb8e82
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-06-20 08:49:44 +00:00
Marcus Tillmanns
6c34e1937c Utils: Fix operator escaping
Stops CommandLine / ProcessArgs from escaping
operators '&&', '||' and ';'.

Fixes: QTCREATORBUG-29280
Change-Id: Idf4f429fec0d96b67266761297eea851c283ac4c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-20 06:23:37 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Marcus Tillmanns
8f1cbd2e52 Utils: Improve and test CommandLine::fromUserInput
Change-Id: Ia18f5b01d91200e6ad65735496395215c6393533
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-03-14 14:40:35 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Marcus Tillmanns
fd829240ed Utils: Fix addCommandLineWithAnd for Windows
Also enable more unittests on windows

Change-Id: I241b77c640949cf622dc8138991036bb066ce3cf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-30 08:02:53 +00:00
Marcus Tillmanns
43b21595e9 Utils: Disable broken commandline tests on windows
Change-Id: I20e89877886b0f9416cca766a119b99191011d1b
Reviewed-by: hjk <hjk@qt.io>
2022-11-24 09:00:32 +00:00
hjk
587bafc771 Utils: Make errors from CommandLine test better readable
Change-Id: Ibea4bbe7c1f7e502849f0ef6985cbf107fc236f0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-23 14:21:49 +00:00
Marcus Tillmanns
3e6c3d9fe7 Utils: Add "addCommandLine..." functions
addCommandLineAsSingleArg allows to reliably create commandlines
like "bash -c 'echo ...'"

addCommandLineWithAnd combines two command lines
by adding '&&' in between

Change-Id: Ic5af34c90fd5271dced40ba1341a3df019ededb8
Reviewed-by: hjk <hjk@qt.io>
2022-11-22 13:17:00 +00:00