forked from qt-creator/qt-creator
ProjectExplorer: Prefer ProcessParameters::setCommandLine
... over setting command and args individually. Change-Id: Iec7c8d3a0b05fb8fa0639f7ddbe7ccdc7387d2a2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <projectexplorer/processparameters.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -103,16 +104,10 @@ void NimCompilerBuildStepConfigWidget::updateCommandLineText()
|
||||
{
|
||||
ProcessParameters *parameters = m_buildStep->processParameters();
|
||||
|
||||
QStringList command;
|
||||
command << parameters->command().toString();
|
||||
command << parameters->arguments();
|
||||
const CommandLine cmd = parameters->command();
|
||||
const QStringList parts = QtcProcess::splitArgs(cmd.toUserOutput());
|
||||
|
||||
// Remove empty args
|
||||
auto predicate = [](const QString & str) { return str.isEmpty(); };
|
||||
auto it = std::remove_if(command.begin(), command.end(), predicate);
|
||||
command.erase(it, command.end());
|
||||
|
||||
m_ui->commandTextEdit->setText(command.join(QChar::LineFeed));
|
||||
m_ui->commandTextEdit->setText(parts.join(QChar::LineFeed));
|
||||
}
|
||||
|
||||
void NimCompilerBuildStepConfigWidget::updateTargetComboBox()
|
||||
|
||||
Reference in New Issue
Block a user