MCPcopy Create free account
hub / github.com/KDE/kdevelop / statusReady

Method statusReady

plugins/git/repostatusmodel.cpp:457–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457void RepoStatusModel::statusReady(KJob* job)
458{
459 auto* status = qobject_cast<VcsJob*>(job);
460 if (!status)
461 return;
462
463 const QList<QVariant> states = status->fetchResults().toList();
464 auto* project = job->property("project").value<IProject*>();
465
466 const auto itProject = projectItem(project);
467 if (!itProject.isValid())
468 return;
469
470 QSet<QUrl> foundUrls;
471 foundUrls.reserve(states.size());
472 for (const auto& state : states) {
473 const VcsStatusInfo st = state.value<VcsStatusInfo>();
474 foundUrls += st.url();
475 updateState(itProject, st);
476 }
477
478 IBasicVersionControl::RecursionMode mode = IBasicVersionControl::RecursionMode(job->property("mode").toInt());
479 const QList<QUrl> projectUrls = childUrls(itProject);
480 const QSet<QUrl> uncertainUrls = QSet<QUrl>(projectUrls.begin(), projectUrls.end()).subtract(foundUrls);
481 const QList<QUrl> sourceUrls = job->property("urls").value<QList<QUrl>>();
482 for (const QUrl& url : sourceUrls) {
483 if (url.isLocalFile() && QDir(url.toLocalFile()).exists()) {
484 for (const QUrl& currentUrl : uncertainUrls) {
485 if ((mode == IBasicVersionControl::NonRecursive
486 && currentUrl.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash)
487 == url.adjusted(QUrl::StripTrailingSlash))
488 || (mode == IBasicVersionControl::Recursive && url.isParentOf(currentUrl))) {
489 removeUrl(currentUrl, itProject.project);
490 }
491 }
492 }
493 }
494}
495
496void RepoStatusModel::documentSaved(const IDocument* document)
497{

Callers

nothing calls this directly

Calls 15

updateStateFunction · 0.85
RecursionModeEnum · 0.85
propertyMethod · 0.80
toIntMethod · 0.80
isLocalFileMethod · 0.80
existsMethod · 0.80
toLocalFileMethod · 0.80
isParentOfMethod · 0.80
QDirClass · 0.70
toListMethod · 0.45
fetchResultsMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected