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

@@ -421,7 +421,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError)
d->currentDateTime = dateTime;
});
const auto setupForEachRef = [=](QtcProcess &process) {
const auto setupForEachRef = [=](Process &process) {
d->workingDirectory = workingDirectory;
QStringList args = {"for-each-ref",
"--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
@@ -433,7 +433,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError)
d->client->setupCommand(process, workingDirectory, args);
};
const auto forEachRefDone = [=](const QtcProcess &process) {
const auto forEachRefDone = [=](const Process &process) {
const QString output = process.stdOut();
const QStringList lines = output.split('\n');
for (const QString &l : lines)
@@ -454,7 +454,7 @@ void BranchModel::refresh(const FilePath &workingDirectory, ShowError showError)
}
};
const auto forEachRefError = [=](const QtcProcess &process) {
const auto forEachRefError = [=](const Process &process) {
if (showError == ShowError::No)
return;
const QString message = Tr::tr("Cannot run \"%1\" in \"%2\": %3")
@@ -919,12 +919,12 @@ void BranchModel::updateUpstreamStatus(BranchNode *node)
if (node->tracking.isEmpty())
return;
QtcProcess *process = new QtcProcess(node);
Process *process = new Process(node);
process->setEnvironment(d->client->processEnvironment());
process->setCommand({d->client->vcsBinary(), {"rev-list", "--no-color", "--left-right",
"--count", node->fullRef() + "..." + node->tracking}});
process->setWorkingDirectory(d->workingDirectory);
connect(process, &QtcProcess::done, this, [this, process, node] {
connect(process, &Process::done, this, [this, process, node] {
process->deleteLater();
if (process->result() != ProcessResult::FinishedWithSuccess)
return;

View File

@@ -542,10 +542,10 @@ TaskTree *BranchView::onFastForwardMerge(const std::function<void()> &callback)
const TreeStorage<FastForwardStorage> storage;
GitClient *client = GitClient::instance();
const auto setupMergeBase = [=](QtcProcess &process) {
const auto setupMergeBase = [=](Process &process) {
client->setupCommand(process, m_repository, {"merge-base", "HEAD", branch});
};
const auto onMergeBaseDone = [storage](const QtcProcess &process) {
const auto onMergeBaseDone = [storage](const Process &process) {
storage->mergeBase = process.cleanedStdOut().trimmed();
};

View File

@@ -209,12 +209,12 @@ void ChangeSelectionDialog::recalculateCompletion()
return;
GitClient *client = GitClient::instance();
QtcProcess *process = new QtcProcess(this);
Process *process = new Process(this);
process->setEnvironment(client->processEnvironment());
process->setCommand({client->vcsBinary(), {"for-each-ref", "--format=%(refname:short)"}});
process->setWorkingDirectory(workingDir);
process->setUseCtrlCStub(true);
connect(process, &QtcProcess::done, this, [this, process] {
connect(process, &Process::done, this, [this, process] {
if (process->result() == ProcessResult::FinishedWithSuccess)
m_changeModel->setStringList(process->cleanedStdOut().split('\n'));
process->deleteLater();
@@ -238,8 +238,8 @@ void ChangeSelectionDialog::recalculateDetails()
return;
}
m_process.reset(new QtcProcess);
connect(m_process.get(), &QtcProcess::done, this, &ChangeSelectionDialog::setDetails);
m_process.reset(new Process);
connect(m_process.get(), &Process::done, this, &ChangeSelectionDialog::setDetails);
m_process->setWorkingDirectory(workingDir);
m_process->setEnvironment(m_gitEnvironment);
m_process->setCommand({m_gitExecutable, {"show", "--decorate", "--stat=80", ref}});

View File

@@ -18,7 +18,7 @@ QT_END_NAMESPACE
namespace Utils {
class CompletingLineEdit;
class PathChooser;
class QtcProcess;
class Process;
} // Utils
namespace Git::Internal {
@@ -53,7 +53,7 @@ private:
void enableButtons(bool b);
std::unique_ptr<Utils::QtcProcess> m_process;
std::unique_ptr<Utils::Process> m_process;
Utils::FilePath m_gitExecutable;
Utils::Environment m_gitEnvironment;
ChangeCommand m_command = NoCommand;

View File

@@ -227,7 +227,7 @@ private:
void errorTermination(const QString &msg);
QtcProcess m_process;
Process m_process;
QTimer m_timer;
FilePath m_binary;
QByteArray m_output;
@@ -259,15 +259,15 @@ QueryContext::QueryContext(const QString &query,
+ "&o=CURRENT_REVISION&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS";
m_arguments = server.curlArguments() << url;
}
connect(&m_process, &QtcProcess::readyReadStandardError, this, [this] {
connect(&m_process, &Process::readyReadStandardError, this, [this] {
const QString text = QString::fromLocal8Bit(m_process.readAllRawStandardError());
VcsOutputWindow::appendError(text);
m_error.append(text);
});
connect(&m_process, &QtcProcess::readyReadStandardOutput, this, [this] {
connect(&m_process, &Process::readyReadStandardOutput, this, [this] {
m_output.append(m_process.readAllRawStandardOutput());
});
connect(&m_process, &QtcProcess::done, this, &QueryContext::processDone);
connect(&m_process, &Process::done, this, &QueryContext::processDone);
m_process.setEnvironment(Git::Internal::GitClient::instance()->processEnvironment());
m_timer.setInterval(timeOutMS);
@@ -340,7 +340,7 @@ void QueryContext::timeout()
arg(timeOutMS / 1000), QMessageBox::NoButton, parent);
QPushButton *terminateButton = box.addButton(Git::Tr::tr("Terminate"), QMessageBox::YesRole);
box.addButton(Git::Tr::tr("Keep Running"), QMessageBox::NoRole);
connect(&m_process, &QtcProcess::done, &box, &QDialog::reject);
connect(&m_process, &Process::done, &box, &QDialog::reject);
box.exec();
if (m_process.state() != QProcess::Running)
return;

View File

@@ -78,7 +78,7 @@ private:
const FetchMode m_fetchMode;
const Utils::FilePath m_git;
const GerritServer m_server;
QtcProcess m_process;
Process m_process;
};
FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
@@ -93,11 +93,11 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
, m_server(server)
{
m_process.setUseCtrlCStub(true);
connect(&m_process, &QtcProcess::done, this, &FetchContext::processDone);
connect(&m_process, &QtcProcess::readyReadStandardError, this, [this] {
connect(&m_process, &Process::done, this, &FetchContext::processDone);
connect(&m_process, &Process::readyReadStandardError, this, [this] {
VcsBase::VcsOutputWindow::append(QString::fromLocal8Bit(m_process.readAllRawStandardError()));
});
connect(&m_process, &QtcProcess::readyReadStandardOutput, this, [this] {
connect(&m_process, &Process::readyReadStandardOutput, this, [this] {
VcsBase::VcsOutputWindow::append(QString::fromLocal8Bit(m_process.readAllRawStandardOutput()));
});
m_process.setWorkingDirectory(repository);

View File

@@ -165,12 +165,12 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document,
const TreeStorage<QString> diffInputStorage = inputStorage();
const auto setupDiff = [=](QtcProcess &process) {
const auto setupDiff = [=](Process &process) {
process.setCodec(VcsBaseEditor::getCodec(workingDirectory(), {}));
setupCommand(process, {addConfigurationArguments(diffArgs(leftCommit, rightCommit, extraArgs))});
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
};
const auto onDiffDone = [diffInputStorage](const QtcProcess &process) {
const auto onDiffDone = [diffInputStorage](const Process &process) {
*diffInputStorage = process.cleanedStdOut();
};
@@ -231,7 +231,7 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin
const TreeStorage<DiffStorage> storage;
const TreeStorage<QString> diffInputStorage = inputStorage();
const auto setupStaged = [this, stagedFiles](QtcProcess &process) {
const auto setupStaged = [this, stagedFiles](Process &process) {
if (stagedFiles.isEmpty())
return TaskAction::StopWithError;
process.setCodec(VcsBaseEditor::getCodec(workingDirectory(), stagedFiles));
@@ -240,11 +240,11 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
return TaskAction::Continue;
};
const auto onStagedDone = [storage](const QtcProcess &process) {
const auto onStagedDone = [storage](const Process &process) {
storage->m_stagedOutput = process.cleanedStdOut();
};
const auto setupUnstaged = [this, unstagedFiles](QtcProcess &process) {
const auto setupUnstaged = [this, unstagedFiles](Process &process) {
if (unstagedFiles.isEmpty())
return TaskAction::StopWithError;
process.setCodec(VcsBaseEditor::getCodec(workingDirectory(), unstagedFiles));
@@ -253,7 +253,7 @@ FileListDiffController::FileListDiffController(IDocument *document, const QStrin
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
return TaskAction::Continue;
};
const auto onUnstagedDone = [storage](const QtcProcess &process) {
const auto onUnstagedDone = [storage](const Process &process) {
storage->m_unstagedOutput = process.cleanedStdOut();
};
@@ -321,13 +321,13 @@ ShowController::ShowController(IDocument *document, const QString &id)
setDescription(desc);
};
const auto setupDescription = [this, id](QtcProcess &process) {
const auto setupDescription = [this, id](Process &process) {
process.setCodec(m_instance->encoding(GitClient::EncodingCommit, workingDirectory()));
setupCommand(process, {"show", "-s", noColorOption, showFormatC, id});
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
setDescription(Tr::tr("Waiting for data..."));
};
const auto onDescriptionDone = [this, storage, updateDescription](const QtcProcess &process) {
const auto onDescriptionDone = [this, storage, updateDescription](const Process &process) {
ReloadStorage *data = storage.activeStorage();
const QString output = process.cleanedStdOut();
data->m_postProcessDescription = output.startsWith("commit ");
@@ -348,12 +348,12 @@ ShowController::ShowController(IDocument *document, const QString &id)
return TaskAction::Continue;
};
const auto setupBranches = [this, storage](QtcProcess &process) {
const auto setupBranches = [this, storage](Process &process) {
storage->m_branches = busyMessage;
setupCommand(process, {"branch", noColorOption, "-a", "--contains", storage->m_commit});
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
};
const auto onBranchesDone = [storage, updateDescription](const QtcProcess &process) {
const auto onBranchesDone = [storage, updateDescription](const Process &process) {
ReloadStorage *data = storage.activeStorage();
data->m_branches.clear();
const QString remotePrefix = "remotes/";
@@ -391,17 +391,17 @@ ShowController::ShowController(IDocument *document, const QString &id)
data->m_branches = data->m_branches.trimmed();
updateDescription(*data);
};
const auto onBranchesError = [storage, updateDescription](const QtcProcess &) {
const auto onBranchesError = [storage, updateDescription](const Process &) {
ReloadStorage *data = storage.activeStorage();
data->m_branches.clear();
updateDescription(*data);
};
const auto setupPrecedes = [this, storage](QtcProcess &process) {
const auto setupPrecedes = [this, storage](Process &process) {
storage->m_precedes = busyMessage;
setupCommand(process, {"describe", "--contains", storage->m_commit});
};
const auto onPrecedesDone = [storage, updateDescription](const QtcProcess &process) {
const auto onPrecedesDone = [storage, updateDescription](const Process &process) {
ReloadStorage *data = storage.activeStorage();
data->m_precedes = process.cleanedStdOut().trimmed();
const int tilde = data->m_precedes.indexOf('~');
@@ -411,7 +411,7 @@ ShowController::ShowController(IDocument *document, const QString &id)
data->m_precedes.chop(2);
updateDescription(*data);
};
const auto onPrecedesError = [storage, updateDescription](const QtcProcess &) {
const auto onPrecedesError = [storage, updateDescription](const Process &) {
ReloadStorage *data = storage.activeStorage();
data->m_precedes.clear();
updateDescription(*data);
@@ -427,10 +427,10 @@ ShowController::ShowController(IDocument *document, const QString &id)
data->m_follows = {busyMessage};
data->m_follows.resize(parents.size());
const auto setupFollow = [this](QtcProcess &process, const QString &parent) {
const auto setupFollow = [this](Process &process, const QString &parent) {
setupCommand(process, {"describe", "--tags", "--abbrev=0", parent});
};
const auto onFollowDone = [data, updateDescription](const QtcProcess &process, int index) {
const auto onFollowDone = [data, updateDescription](const Process &process, int index) {
data->m_follows[index] = process.cleanedStdOut().trimmed();
updateDescription(*data);
};
@@ -448,13 +448,13 @@ ShowController::ShowController(IDocument *document, const QString &id)
taskTree.setupRoot(tasks);
};
const auto setupDiff = [this, id](QtcProcess &process) {
const auto setupDiff = [this, id](Process &process) {
setupCommand(process, addConfigurationArguments(
{"show", "--format=format:", // omit header, already generated
noColorOption, decorateOption, id}));
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
};
const auto onDiffDone = [diffInputStorage](const QtcProcess &process) {
const auto onDiffDone = [diffInputStorage](const Process &process) {
*diffInputStorage = process.cleanedStdOut();
};
@@ -1736,10 +1736,10 @@ Utils::Tasking::ProcessTask GitClient::topRevision(
{
using namespace Tasking;
const auto setupProcess = [=](QtcProcess &process) {
const auto setupProcess = [=](Process &process) {
setupCommand(process, workingDirectory, {"show", "-s", "--pretty=format:%H:%ct", HEAD});
};
const auto onProcessDone = [=](const QtcProcess &process) {
const auto onProcessDone = [=](const Process &process) {
const QStringList output = process.cleanedStdOut().trimmed().split(':');
QDateTime dateTime;
if (output.size() > 1) {
@@ -2424,7 +2424,7 @@ void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const
{
const FilePath repBrowserBinary = settings().repositoryBrowserCmd.filePath();
if (!repBrowserBinary.isEmpty())
QtcProcess::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory);
Process::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory);
}
static FilePath gitBinDir(const GitClient::GitKLaunchTrial trial, const FilePath &parentDir)
@@ -2471,18 +2471,18 @@ void GitClient::tryLaunchingGitK(const Environment &env,
// This should always use QtcProcess::startDetached (as not to kill
// the child), but that does not have an environment parameter.
if (!settings().path.value().isEmpty()) {
auto process = new QtcProcess(const_cast<GitClient*>(this));
auto process = new Process(const_cast<GitClient*>(this));
process->setWorkingDirectory(workingDirectory);
process->setEnvironment(env);
process->setCommand({binary, arguments});
connect(process, &QtcProcess::done, this, [=] {
connect(process, &Process::done, this, [=] {
if (process->result() == ProcessResult::StartFailed)
handleGitKFailedToStart(env, workingDirectory, fileName, trial, gitBinDirectory);
process->deleteLater();
});
process->start();
} else {
if (!QtcProcess::startDetached({binary, arguments}, workingDirectory))
if (!Process::startDetached({binary, arguments}, workingDirectory))
handleGitKFailedToStart(env, workingDirectory, fileName, trial, gitBinDirectory);
}
}
@@ -2519,7 +2519,7 @@ bool GitClient::launchGitGui(const FilePath &workingDirectory) {
if (gitBinary.isEmpty()) {
success = false;
} else {
success = QtcProcess::startDetached({gitBinary, {"gui"}}, workingDirectory);
success = Process::startDetached({gitBinary, {"gui"}}, workingDirectory);
}
if (!success)
@@ -2564,7 +2564,7 @@ bool GitClient::launchGitBash(const FilePath &workingDirectory)
success = false;
} else {
const FilePath gitBash = git.absolutePath().parentDir() / "git-bash.exe";
success = QtcProcess::startDetached({gitBash, {}}, workingDirectory);
success = Process::startDetached({gitBash, {}}, workingDirectory);
}
if (!success)
@@ -3466,8 +3466,8 @@ QFuture<unsigned> GitClient::gitVersion() const
const FilePath newGitBinary = vcsBinary();
const bool needToRunGit = m_gitVersionForBinary != newGitBinary && !newGitBinary.isEmpty();
if (needToRunGit) {
auto proc = new QtcProcess(const_cast<GitClient *>(this));
connect(proc, &QtcProcess::done, this, [this, proc, fi, newGitBinary]() mutable {
auto proc = new Process(const_cast<GitClient *>(this));
connect(proc, &Process::done, this, [this, proc, fi, newGitBinary]() mutable {
if (proc->result() == ProcessResult::FinishedWithSuccess) {
m_cachedGitVersion = parseGitVersion(proc->cleanedStdOut());
m_gitVersionForBinary = newGitBinary;

View File

@@ -161,7 +161,7 @@ public:
});
arguments << "--" << filterArgs << exclusionArgs;
QtcProcess process;
Process process;
process.setEnvironment(m_environment);
process.setCommand({m_vcsBinary, arguments});
process.setWorkingDirectory(m_directory);

View File

@@ -23,8 +23,8 @@ namespace Git::Internal {
MergeTool::MergeTool(QObject *parent) : QObject(parent)
{
connect(&m_process, &QtcProcess::done, this, &MergeTool::done);
connect(&m_process, &QtcProcess::readyReadStandardOutput, this, &MergeTool::readData);
connect(&m_process, &Process::done, this, &MergeTool::done);
connect(&m_process, &Process::readyReadStandardOutput, this, &MergeTool::readData);
Environment env = Environment::systemEnvironment();
env.set("LANG", "C");
env.set("LANGUAGE", "C");

View File

@@ -49,7 +49,7 @@ private:
void chooseAction();
void addButton(QMessageBox *msgBox, const QString &text, char key);
Utils::QtcProcess m_process;
Utils::Process m_process;
MergeType m_mergeType = NormalMerge;
QString m_fileName;
FileState m_localState = UnknownState;