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

Method revertSelectedFiles

plugins/git/committoolview.cpp:403–421  ·  view source on GitHub ↗

Note that the this is a dangerous operation; we rely on the vcs job to show a confirmation dialog

Source from the content-addressed store, hash-verified

401// Note that the this is a dangerous operation;
402// we rely on the vcs job to show a confirmation dialog
403void CommitToolView::revertSelectedFiles ( const QList<QUrl>& urls )
404{
405
406 IProject* project = ICore::self()->projectController()->findProjectForUrl(urls.front());
407 IBasicVersionControl* vcs = vcsPluginForUrl(urls.front());
408
409 if (vcs) {
410 VcsJob* job = vcs->revert(urls, IBasicVersionControl::NonRecursive);
411 job->setProperty("urls", QVariant::fromValue<QList<QUrl>>(urls));
412 job->setProperty("project", QVariant::fromValue(project));
413 ICore::self()->runController()->registerJob(job);
414 connect(job, &VcsJob::resultsReady, this, [=]() {
415 // Close the document tabs showing diffs for the urls
416 for (const auto& url : urls) {
417 emit updateUrlDiffs(url);
418 }
419 });
420 }
421}
422
423void CommitToolView::stageSelectedFiles ( const QList<QUrl>& urls )
424{

Callers

nothing calls this directly

Calls 6

findProjectForUrlMethod · 0.80
projectControllerMethod · 0.80
setPropertyMethod · 0.80
registerJobMethod · 0.80
runControllerMethod · 0.80
revertMethod · 0.45

Tested by

no test coverage detected