| 1360 | } |
| 1361 | |
| 1362 | void ProjectController::reparseProject(IProject* project, bool forceUpdate, bool forceAll) |
| 1363 | { |
| 1364 | Q_D(ProjectController); |
| 1365 | |
| 1366 | if (auto* oldJob = d->m_parseJobs.value(project)) { |
| 1367 | oldJob->kill(); // Removes oldJob from m_parseJobs. |
| 1368 | } |
| 1369 | |
| 1370 | auto& job = d->m_parseJobs[project]; |
| 1371 | job = new ParseProjectJob(project, forceUpdate, forceAll || parseAllProjectSources()); |
| 1372 | connect(job, &KJob::finished, this, [d, project](KJob* job) { |
| 1373 | const auto it = d->m_parseJobs.constFind(project); |
| 1374 | if (it != d->m_parseJobs.cend() && *it == job) { |
| 1375 | d->m_parseJobs.erase(it); |
| 1376 | } |
| 1377 | }); |
| 1378 | ICore::self()->runController()->registerJob(job); |
| 1379 | } |
| 1380 | |
| 1381 | } |
| 1382 |
no test coverage detected