MCPcopy Create free account
hub / github.com/KDE/kate / openCommit

Method openCommit

apps/lib/commitfilesview.cpp:458–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458void CommitDiffTreeView::openCommit(const QString &hash)
459{
460 m_commitHash = hash;
461
462 auto *git = new QProcess(this);
463 if (!setupGitProcess(*git,
464 m_gitDir,
465 {QStringLiteral("show"), hash, QStringLiteral("--numstat"), QStringLiteral("--pretty=oneline"), QStringLiteral("-z")})) {
466 delete git;
467 return;
468 }
469
470 connect(git, &QProcess::finished, this, [this, git](int e, QProcess::ExitStatus s) {
471 git->deleteLater();
472 if (e != 0 || s != QProcess::NormalExit) {
473 Utils::showMessage(QString::fromUtf8(git->readAllStandardError()), gitIcon(), i18n("Git"), MessageType::Error, m_mainWindow);
474 m_backBtn.click();
475 return;
476 }
477 QByteArray contents = git->readAllStandardOutput();
478 int firstNull = contents.indexOf(char(0x00));
479 if (firstNull == -1) {
480 return;
481 }
482 QByteArray numstat = contents.mid(firstNull + 1);
483 createFileTreeForCommit(numstat);
484 });
485 startHostProcess(*git);
486}
487
488void CommitDiffTreeView::createFileTreeForCommit(const QByteArray &rawNumStat)
489{

Callers

nothing calls this directly

Calls 11

setupGitProcessFunction · 0.85
showMessageFunction · 0.85
gitIconFunction · 0.85
startHostProcessFunction · 0.85
getRepoBasePathFunction · 0.85
indexOfMethod · 0.80
activeMainWindowMethod · 0.80
valueMethod · 0.80
toolviewForNameFunction · 0.70
createToolViewMethod · 0.45
showToolViewMethod · 0.45

Tested by

no test coverage detected