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

Method integrateData

plugins/cmake/cmakemanager.cpp:505–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505void CMakeManager::integrateData(const CMakeProjectData &data, KDevelop::IProject* project, const QSharedPointer<CMakeServer>& server)
506{
507 // TODO: show the warning message only after the entire import job finishes. When the message
508 // is shown here (earlier), the user can follow the advice and manage to reload the project
509 // before the current import finishes. Then KDevelop would print a kdevelop.plugins.cmake.debug
510 // message "the project is being reloaded, aborting reload!" and ignore the reload request.
511 if (data.isOutdated) {
512 showConfigureOutdatedMessage(*project);
513 }
514
515 if (server) {
516 connect(server.data(), &CMakeServer::response, project, [this, project](const QJsonObject& response) {
517 if (response[QStringLiteral("type")] == QLatin1String("signal")) {
518 if (response[QStringLiteral("name")] == QLatin1String("dirty")) {
519 m_projects[project].server->configure({});
520 } else
521 qCDebug(CMAKE) << "unhandled signal response..." << project << response;
522 } else if (response[QStringLiteral("type")] == QLatin1String("error")) {
523 showConfigureErrorMessage(*project, response[QStringLiteral("errorMessage")].toString());
524 } else if (response[QStringLiteral("type")] == QLatin1String("reply")) {
525 const auto inReplyTo = response[QStringLiteral("inReplyTo")];
526 if (inReplyTo == QLatin1String("configure")) {
527 m_projects[project].server->compute();
528 } else if (inReplyTo == QLatin1String("compute")) {
529 m_projects[project].server->codemodel();
530 } else if(inReplyTo == QLatin1String("codemodel")) {
531 auto &data = m_projects[project].data;
532 CMakeServerImportJob::processCodeModel(response, data);
533 populateTargets(project->projectItem(), data.targets);
534 } else {
535 qCDebug(CMAKE) << "unhandled reply response..." << project << response;
536 }
537 } else {
538 qCDebug(CMAKE) << "unhandled response..." << project << response;
539 }
540 });
541 } else if (!m_projects.contains(project)) {
542 auto* reloadTimer = new QTimer(project);
543 reloadTimer->setSingleShot(true);
544 reloadTimer->setInterval(1000);
545 connect(reloadTimer, &QTimer::timeout, this, [project, this]() {
546 reload(project->projectItem());
547 });
548 connect(projectWatcher(project), &KDirWatch::dirty, reloadTimer, [this, project, reloadTimer](const QString &strPath) {
549 const auto it = m_projects.constFind(project);
550 if (it == m_projects.cend() || !it->data.cmakeFiles.contains(Path{strPath})) {
551 return;
552 }
553 qCDebug(CMAKE) << "eventually starting reload due to change of" << strPath;
554 reloadTimer->start();
555 });
556 }
557
558 auto& projectData = m_projects[project];
559 cleanupTestSuites(projectData.testSuites, projectData.testSuiteJobs);
560
561 QVector<CTestSuite*> testSuites;
562 QVector<CTestFindJob*> testSuiteJobs;

Callers 3

successfulConnectionMethod · 0.80
failedConnectionMethod · 0.80
fileImportDoneMethod · 0.80

Calls 15

populateTargetsFunction · 0.85
computeMethod · 0.80
codemodelMethod · 0.80
releaseMethod · 0.80
testControllerMethod · 0.80
removeOneMethod · 0.80
registerJobMethod · 0.80
runControllerMethod · 0.80
cleanupTestSuitesFunction · 0.70
dataMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected