Note that the this is a dangerous operation; we rely on the vcs job to show a confirmation dialog
| 401 | // Note that the this is a dangerous operation; |
| 402 | // we rely on the vcs job to show a confirmation dialog |
| 403 | void 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 | |
| 423 | void CommitToolView::stageSelectedFiles ( const QList<QUrl>& urls ) |
| 424 | { |
nothing calls this directly
no test coverage detected