forked from qt-creator/qt-creator
Utils: Add CommandLine::prependArgs convenience functions
For clearer code on the user side. Change-Id: I3adf2e96628f4e59293cd2f0966fb30989e0da9f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1485,6 +1485,21 @@ void CommandLine::addArgs(const QString &inArgs, RawType)
|
||||
ProcessArgs::addArgs(&m_arguments, inArgs);
|
||||
}
|
||||
|
||||
void CommandLine::prependArgs(const QStringList &inArgs)
|
||||
{
|
||||
QString oldArgs = m_arguments;
|
||||
m_arguments.clear();
|
||||
addArgs(inArgs);
|
||||
addArgs(oldArgs, Raw);
|
||||
}
|
||||
|
||||
void CommandLine::prependArgs(const QString &inArgs, RawType)
|
||||
{
|
||||
QString oldArgs = m_arguments;
|
||||
m_arguments = inArgs;
|
||||
addArgs(oldArgs, Raw);
|
||||
}
|
||||
|
||||
QString CommandLine::toUserOutput() const
|
||||
{
|
||||
QString res = m_executable.toUserOutput();
|
||||
|
@@ -143,12 +143,14 @@ public:
|
||||
|
||||
void addArg(const QString &arg);
|
||||
void addArgs(const QStringList &inArgs);
|
||||
void addArgs(const QString &inArgs, RawType);
|
||||
|
||||
void prependArgs(const QStringList &inArgs);
|
||||
void prependArgs(const QString &inArgs, RawType);
|
||||
|
||||
void addCommandLineAsArgs(const CommandLine &cmd);
|
||||
void addCommandLineAsArgs(const CommandLine &cmd, RawType);
|
||||
|
||||
void addArgs(const QString &inArgs, RawType);
|
||||
|
||||
QString toUserOutput() const;
|
||||
|
||||
FilePath executable() const { return m_executable; }
|
||||
|
Reference in New Issue
Block a user