Utils: Rename QtcProcess -> Process

Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-05-03 16:00:22 +02:00
parent e5051bbfde
commit 470c95c94b
244 changed files with 769 additions and 769 deletions

View File

@@ -27,9 +27,9 @@ const char pipInstallTaskId[] = "Python::pipInstallTask";
PipInstallTask::PipInstallTask(const FilePath &python)
: m_python(python)
{
connect(&m_process, &QtcProcess::done, this, &PipInstallTask::handleDone);
connect(&m_process, &QtcProcess::readyReadStandardError, this, &PipInstallTask::handleError);
connect(&m_process, &QtcProcess::readyReadStandardOutput, this, &PipInstallTask::handleOutput);
connect(&m_process, &Process::done, this, &PipInstallTask::handleDone);
connect(&m_process, &Process::readyReadStandardError, this, &PipInstallTask::handleError);
connect(&m_process, &Process::readyReadStandardOutput, this, &PipInstallTask::handleOutput);
connect(&m_killTimer, &QTimer::timeout, this, &PipInstallTask::cancel);
connect(&m_watcher, &QFutureWatcher<void>::canceled, this, &PipInstallTask::cancel);
m_watcher.setFuture(m_future.future());
@@ -160,7 +160,7 @@ static PipPackageInfo infoImpl(const PipPackage &package, const FilePath &python
{
PipPackageInfo result;
QtcProcess pip;
Process pip;
pip.setCommand(CommandLine(python, {"-m", "pip", "show", "-f", package.packageName}));
pip.runBlocking();
QString fieldName;

View File

@@ -80,7 +80,7 @@ private:
const Utils::FilePath m_python;
QList<PipPackage> m_packages;
Utils::QtcProcess m_process;
Utils::Process m_process;
QFutureInterface<void> m_future;
QFutureWatcher<void> m_watcher;
QTimer m_killTimer;

View File

@@ -55,7 +55,7 @@ bool PySideInstaller::missingPySideInstallation(const FilePath &pythonPath,
if (pythonWithPyside[pythonPath].contains(pySide))
return false;
QtcProcess pythonProcess;
Process pythonProcess;
pythonProcess.setCommand({pythonPath, {"-c", "import " + pySide}});
pythonProcess.runBlocking();
const bool missing = pythonProcess.result() != ProcessResult::FinishedWithSuccess;

View File

@@ -30,7 +30,7 @@ FilePath PySideUicExtraCompiler::command() const
return m_pySideUic;
}
FileNameToContentsHash PySideUicExtraCompiler::handleProcessFinished(QtcProcess *process)
FileNameToContentsHash PySideUicExtraCompiler::handleProcessFinished(Process *process)
{
FileNameToContentsHash result;
if (process->exitStatus() != QProcess::NormalExit && process->exitCode() != 0)

View File

@@ -21,7 +21,7 @@ public:
private:
Utils::FilePath command() const override;
ProjectExplorer::FileNameToContentsHash handleProcessFinished(
Utils::QtcProcess *process) override;
Utils::Process *process) override;
Utils::FilePath m_pySideUic;
};

View File

@@ -80,7 +80,7 @@ FilePath getPylsModulePath(CommandLine pylsCommand)
pylsCommand.addArg("-h");
QtcProcess pythonProcess;
Process pythonProcess;
Environment env = pythonProcess.environment();
env.set("PYTHONVERBOSE", "x");
pythonProcess.setEnvironment(env);
@@ -114,7 +114,7 @@ static PythonLanguageServerState checkPythonLanguageServer(const FilePath &pytho
const CommandLine pythonLShelpCommand(python, {"-m", "pylsp", "-h"});
const FilePath &modulePath = getPylsModulePath(pythonLShelpCommand);
QtcProcess pythonProcess;
Process pythonProcess;
pythonProcess.setCommand(pythonLShelpCommand);
pythonProcess.runBlocking();
if (pythonProcess.allOutput().contains("Python Language Server"))

View File

@@ -62,7 +62,7 @@ static Interpreter createInterpreter(const FilePath &python,
result.id = QUuid::createUuid().toString();
result.command = python;
QtcProcess pythonProcess;
Process pythonProcess;
pythonProcess.setProcessChannelMode(QProcess::MergedChannels);
pythonProcess.setTimeoutS(1);
pythonProcess.setCommand({python, {"--version"}});

View File

@@ -116,13 +116,13 @@ void openPythonRepl(QObject *parent, const FilePath &file, ReplType type)
};
const auto args = QStringList{"-i"} + replImportArgs(file, type);
auto process = new QtcProcess(parent);
auto process = new Process(parent);
process->setTerminalMode(TerminalMode::On);
const FilePath pythonCommand = detectPython(file);
process->setCommand({pythonCommand, args});
process->setWorkingDirectory(workingDir(file));
const QString commandLine = process->commandLine().toUserOutput();
QObject::connect(process, &QtcProcess::done, process, [process, commandLine] {
QObject::connect(process, &Process::done, process, [process, commandLine] {
if (process->error() != QProcess::UnknownError) {
Core::MessageManager::writeDisrupting(Tr::tr(
(process->error() == QProcess::FailedToStart)
@@ -142,7 +142,7 @@ QString pythonName(const FilePath &pythonPath)
return {};
QString name = nameForPython.value(pythonPath);
if (name.isEmpty()) {
QtcProcess pythonProcess;
Process pythonProcess;
pythonProcess.setTimeoutS(2);
pythonProcess.setCommand({pythonPath, {"--version"}});
pythonProcess.runBlocking();
@@ -174,10 +174,10 @@ void createVenv(const Utils::FilePath &python,
const CommandLine command(python, QStringList{"-m", "venv", venvPath.toUserOutput()});
auto process = new QtcProcess;
auto process = new Process;
auto progress = new Core::ProcessProgress(process);
progress->setDisplayName(Tr::tr("Create Python venv"));
QObject::connect(process, &QtcProcess::done, [process, callback](){
QObject::connect(process, &Process::done, [process, callback](){
callback(process->result() == ProcessResult::FinishedWithSuccess);
process->deleteLater();
});