forked from qt-creator/qt-creator
ConsoleProcess: Uniform the common interface of QtcProcess
This is a preliminary step before merging ConsoleProcess into QtcProcess. Rename command() to commandLine(). Return const references from commandLine() and from environment(). Change-Id: Iacbf48030d00f8dbba053ece70bd460924f96041 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -190,7 +190,7 @@ void ConsoleProcess::setCommand(const CommandLine &command)
|
||||
d->m_commandLine = command;
|
||||
}
|
||||
|
||||
CommandLine ConsoleProcess::command() const
|
||||
const CommandLine &ConsoleProcess::commandLine() const
|
||||
{
|
||||
return d->m_commandLine;
|
||||
}
|
||||
@@ -973,7 +973,7 @@ void ConsoleProcess::setEnvironment(const Environment &env)
|
||||
d->m_environment = env;
|
||||
}
|
||||
|
||||
Environment ConsoleProcess::environment() const
|
||||
const Utils::Environment &ConsoleProcess::environment() const
|
||||
{
|
||||
return d->m_environment;
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
~ConsoleProcess() override;
|
||||
|
||||
void setCommand(const Utils::CommandLine &command);
|
||||
Utils::CommandLine command() const;
|
||||
const Utils::CommandLine &commandLine() const;
|
||||
|
||||
void setAbortOnMetaChars(bool abort);
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
Utils::FilePath workingDirectory() const;
|
||||
|
||||
void setEnvironment(const Environment &env);
|
||||
Environment environment() const;
|
||||
const Environment &environment() const;
|
||||
|
||||
void setRunAsRoot(bool on);
|
||||
|
||||
|
@@ -111,7 +111,7 @@ void openPythonRepl(QObject *parent, const FilePath &file, ReplType type)
|
||||
const FilePath pythonCommand = detectPython(file);
|
||||
process->setCommand({pythonCommand, args});
|
||||
process->setWorkingDirectory(workingDir(file));
|
||||
const QString commandLine = process->command().toUserOutput();
|
||||
const QString commandLine = process->commandLine().toUserOutput();
|
||||
QObject::connect(process,
|
||||
&ConsoleProcess::errorOccurred,
|
||||
process,
|
||||
|
Reference in New Issue
Block a user