| 1269 | } |
| 1270 | |
| 1271 | void ProjectController::commitCurrentProject() |
| 1272 | { |
| 1273 | IDocument* doc=ICore::self()->documentController()->activeDocument(); |
| 1274 | if(!doc) |
| 1275 | return; |
| 1276 | |
| 1277 | QUrl url=doc->url(); |
| 1278 | IProject* project = ICore::self()->projectController()->findProjectForUrl(url); |
| 1279 | if (!project) |
| 1280 | return; |
| 1281 | |
| 1282 | IPlugin* plugin = project->versionControlPlugin(); |
| 1283 | if (!plugin) |
| 1284 | return; |
| 1285 | auto* vcs = plugin->extension<IBasicVersionControl>(); |
| 1286 | if (!vcs) |
| 1287 | return; |
| 1288 | |
| 1289 | if (!ICore::self()->documentController()->saveAllDocuments(IDocumentController::SaveSelectionMode::DontAskUser)) { |
| 1290 | return; // canceled by the user |
| 1291 | } |
| 1292 | |
| 1293 | const Path basePath = project->path(); |
| 1294 | auto* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(vcs, basePath.toUrl())); |
| 1295 | |
| 1296 | bool ret = showVcsDiff(patchSource); |
| 1297 | |
| 1298 | if (!ret) { |
| 1299 | ScopedDialog<VcsCommitDialog> commitDialog(patchSource); |
| 1300 | commitDialog->setCommitCandidates(patchSource->infos()); |
| 1301 | commitDialog->exec(); |
| 1302 | } |
| 1303 | } |
| 1304 | |
| 1305 | QString ProjectController::mapSourceBuild( const QString& path_, bool reverse, bool fallbackRoot ) const |
| 1306 | { |
nothing calls this directly
no test coverage detected