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>
This commit is contained in:
hjk
2021-08-12 13:04:22 +02:00
parent d735d3238f
commit 20a63d6c7e
7 changed files with 20 additions and 22 deletions

View File

@@ -138,9 +138,10 @@ public:
CommandLine(const FilePath &exe, const QStringList &args);
CommandLine(const FilePath &exe, const QString &unparsedArgs, RawType);
void addArg(const QString &arg, OsType osType = HostOsInfo::hostOs());
void addArgs(const QStringList &inArgs, OsType osType = HostOsInfo::hostOs());
void addArgs(const CommandLine &cmd, OsType osType = HostOsInfo::hostOs());
void addArg(const QString &arg);
void addArgs(const QStringList &inArgs);
void addCommandLineAsArgs(const CommandLine &cmd);
void addArgs(const QString &inArgs, RawType);
@@ -152,7 +153,7 @@ public:
QString arguments() const { return m_arguments; }
void setArguments(const QString &args) { m_arguments = args; }
QStringList splitArguments(OsType osType = HostOsInfo::hostOs()) const;
QStringList splitArguments() const;
bool isEmpty() const { return m_executable.isEmpty(); }