Commit Graph

16 Commits

Author SHA1 Message Date
hjk
31f0ba4ef9 Utils: Introduce FilePath::displayName()
To produce "<filepath> on <devicename>" which is nicer to read than
"<scheme>://<deviceid>/<filepath>" in some places.

Change-Id: Ife47bbf49382cf73dd4709d826bdeaa8730f88be
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-02 15:14:27 +00:00
hjk
ae42604904 Utils: Add CommandLine::prependArgs convenience functions
For clearer code on the user side.

Change-Id: I3adf2e96628f4e59293cd2f0966fb30989e0da9f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-25 10:26:46 +00:00
Jarek Kobus
c31285d317 GenericLinuxDeviceTester: Use FileTransfer for sftp and rsync
Make ProcessArgs::prepareCommand() return false in case
when executable is a relative path and it can't be found.

Amends 13067a7d9c

Change-Id: I0c4cf1580be34894df01245eb2411cdd7a122651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-20 09:19:59 +00:00
Robert Löhning
7c942cfd18 Remove outdated code
Change-Id: I65e0ed79dabd987bc67d4082969835d52dd7cb8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-09 18:53:36 +00:00
hjk
95c9579c58 ProjectExplorer: Normalize DeviceProcess::start() signature
Change-Id: I2915be34d4a1eed64567874dcf0263b7583cc142
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-14 15:10:12 +00:00
Christian Stenger
93d67dd6ac Utils: Fix missing include
Amends 5967dd52ed.

Change-Id: I0fe1f8f9967eac679c32c9e6288249f8a0c575ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-18 05:45:13 +00:00
Jarek Kobus
5967dd52ed CommandLine: implement debug streaming operator
Change-Id: I09a47d70d5bea315efa1af505f7afc69c8075310
Reviewed-by: hjk <hjk@qt.io>
2021-11-17 10:48:45 +00:00
Orgad Shaneh
13067a7d9c CommandLine: Find executable in PATH when it is relative
Task-number: QTCREATORBUG-26329
Change-Id: Ie7b30ea5c73d11e4a9961bdaa732ee36e0e377e7
Reviewed-by: hjk <hjk@qt.io>
2021-09-30 07:04:33 +00:00
hjk
d119c717c1 Core: Use Utils::CommandLine in ExecuteFilter
... using a new CommandLine::fromUserInput convenience function.

Change-Id: Ic786530af89ec80f4211e66f36caa22cb705effe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-24 07:53:29 +00:00
hjk
20a63d6c7e Utils: Drop OsType parameter from CommandLine functions
The type is implicitly given by the command's executble FilePath.

Also, rename the rarely used addArgs(const CommandLine &) overload
to addCommandLineAsArgs() and make it strip scheme and host from
the wrapped executable as there are no uses expected where keeping
them would be the right thing.

Change-Id: Id0b76778e7e01ac16e477f36bf30bb28d96bb177
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 07:36:04 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
hjk
c3077fde55 Utils: Rename cmd parameter to args in prepareArgs
That's what it is.

Change-Id: I45fa1de000cdd25990d3e292bc129a8a12af65c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:59 +00:00
hjk
0567f35e21 Utils: Use Utils::CommandLine as input for ProcessArgs::prepareCommand
Change-Id: Ib5878a159bda0e6b6253f1f4e1abc1acb5ecb573
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:52 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
hjk
4eec360563 Utils: Remove one ProcessArgs::expandMacros overload
Only used once.

Also allow logging of expansion failures.

Change-Id: I357ed6ed28fe379d482358c46b495bc727f86902
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-06 11:36:09 +00:00
Eike Ziller
f18ac508e8 Move CommandLine out of fileutils.h
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>
2021-05-11 13:27:23 +00:00