forked from qt-creator/qt-creator
Utils: Add CommandLine::addArgs(const CommandLine &cmd) convenience
This adds cmd's executable and arguments one by one to this commandline. Useful to construct command lines for 'sudo', 'nice', etc. Change-Id: I76067bc10e269b8e7ff4d945449be3633b321281 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -106,6 +106,14 @@ void CommandLine::addArgs(const QStringList &inArgs, OsType osType)
|
||||
addArg(arg, osType);
|
||||
}
|
||||
|
||||
// Adds cmd's executable and arguments one by one to this commandline.
|
||||
// Useful for 'sudo', 'nice', etc
|
||||
void CommandLine::addArgs(const CommandLine &cmd, OsType osType)
|
||||
{
|
||||
addArg(cmd.executable().toString());
|
||||
addArgs(cmd.splitArguments(osType));
|
||||
}
|
||||
|
||||
void CommandLine::addArgs(const QString &inArgs, RawType)
|
||||
{
|
||||
QtcProcess::addArgs(&m_arguments, inArgs);
|
||||
|
@@ -148,6 +148,7 @@ public:
|
||||
|
||||
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 addArgs(const QString &inArgs, RawType);
|
||||
|
||||
|
Reference in New Issue
Block a user