diff --git a/src/common/util/eventdefinitions.h b/src/common/util/eventdefinitions.h index 9326b4b06..21a89689d 100644 --- a/src/common/util/eventdefinitions.h +++ b/src/common/util/eventdefinitions.h @@ -20,7 +20,7 @@ OPI_OBJECT(project, OPI_INTERFACE(openProject, "kitName", "language", "workspace") OPI_INTERFACE(activeProject, "kitName", "language", "workspace") // out - OPI_INTERFACE(activedProject, "projectInfo") + OPI_INTERFACE(activatedProject, "projectInfo") OPI_INTERFACE(deletedProject, "projectInfo") OPI_INTERFACE(createdProject, "projectInfo") OPI_INTERFACE(projectUpdated, "projectInfo") diff --git a/src/plugins/builder/mainframe/buildmanager.cpp b/src/plugins/builder/mainframe/buildmanager.cpp index f51c716f3..e5c4730bf 100644 --- a/src/plugins/builder/mainframe/buildmanager.cpp +++ b/src/plugins/builder/mainframe/buildmanager.cpp @@ -395,13 +395,13 @@ void BuildManager::slotResetBuildUI() uiController.switchContext(tr("&Build")); } -void BuildManager::setActivedProjectInfo(const QString &kitName, const QString &workingDir) +void BuildManager::setActivatedProjectInfo(const QString &kitName, const QString &workingDir) { d->activedKitName = kitName; d->activedWorkingDir = workingDir; } -void BuildManager::clearActivedProjectInfo() +void BuildManager::clearActivatedProjectInfo() { d->activedKitName.clear(); d->activedWorkingDir.clear(); diff --git a/src/plugins/builder/mainframe/buildmanager.h b/src/plugins/builder/mainframe/buildmanager.h index e48277c44..f3e01c514 100644 --- a/src/plugins/builder/mainframe/buildmanager.h +++ b/src/plugins/builder/mainframe/buildmanager.h @@ -33,8 +33,8 @@ class BuildManager : public QObject ProblemOutputPane *getProblemOutputPane() const; DTK_WIDGET_NAMESPACE::DWidget *getCompileWidget() const; - void setActivedProjectInfo(const QString &kitName, const QString &workingDir); - void clearActivedProjectInfo(); + void setActivatedProjectInfo(const QString &kitName, const QString &workingDir); + void clearActivatedProjectInfo(); bool handleCommand(const QList &info, bool isSynchronous); diff --git a/src/plugins/builder/transceiver/builderreceiver.cpp b/src/plugins/builder/transceiver/builderreceiver.cpp index 164b93870..76c4245b1 100644 --- a/src/plugins/builder/transceiver/builderreceiver.cpp +++ b/src/plugins/builder/transceiver/builderreceiver.cpp @@ -25,18 +25,18 @@ QStringList BuilderReceiver::topics() void BuilderReceiver::eventProcess(const dpf::Event &event) { - if (event.data() == project.activedProject.name) { - QVariant proInfoVar = event.property(project.activedProject.pKeys[0]); + if (event.data() == project.activatedProject.name) { + QVariant proInfoVar = event.property(project.activatedProject.pKeys[0]); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); - BuildManager::instance()->setActivedProjectInfo(projectInfo.kitName(), projectInfo.workspaceFolder()); + BuildManager::instance()->setActivatedProjectInfo(projectInfo.kitName(), projectInfo.workspaceFolder()); } else if (event.data() == project.createdProject.name) { QVariant proInfoVar = event.property(project.createdProject.pKeys[0]); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); - BuildManager::instance()->setActivedProjectInfo(projectInfo.kitName(), projectInfo.workspaceFolder()); + BuildManager::instance()->setActivatedProjectInfo(projectInfo.kitName(), projectInfo.workspaceFolder()); } else if (event.data() == project.deletedProject.name) { QVariant proInfoVar = event.property(project.deletedProject.pKeys[0]); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); - BuildManager::instance()->clearActivedProjectInfo(); + BuildManager::instance()->clearActivatedProjectInfo(); } else if (event.data() == symbol.parseDone.name) { bool bSuccess = event.property("success").toBool(); if(!bSuccess) { diff --git a/src/plugins/cxx/cmake/project/transceiver/projectcmakereceiver.cpp b/src/plugins/cxx/cmake/project/transceiver/projectcmakereceiver.cpp index e94c5c59a..a6c95e36e 100644 --- a/src/plugins/cxx/cmake/project/transceiver/projectcmakereceiver.cpp +++ b/src/plugins/cxx/cmake/project/transceiver/projectcmakereceiver.cpp @@ -35,8 +35,8 @@ void ProjectCmakeReceiver::eventProcess(const dpf::Event &event) builderEvent(event); } - if (event.data() == project.activedProject.name) { - QVariant proInfoVar = event.property(project.activedProject.pKeys[0]); + if (event.data() == project.activatedProject.name) { + QVariant proInfoVar = event.property(project.activatedProject.pKeys[0]); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); TargetsManager::instance()->readTargets(projectInfo.buildFolder(), projectInfo.workspaceFolder()); } diff --git a/src/plugins/debugger/dap/dapdebugger.cpp b/src/plugins/debugger/dap/dapdebugger.cpp index 8b172d54e..0eca9fb6f 100644 --- a/src/plugins/debugger/dap/dapdebugger.cpp +++ b/src/plugins/debugger/dap/dapdebugger.cpp @@ -197,12 +197,12 @@ void DAPDebugger::startDebug() if (d->currentSession == d->remoteSession) d->currentSession = d->localSession; - updateRunState(kPreparing); auto &ctx = dpfInstance.serviceContext(); LanguageService *service = ctx.service(LanguageService::name()); if (service) { auto generator = service->create(d->activeProjectKitName); if (generator) { + updateRunState(kPreparing); if (generator->isNeedBuild()) { d->currentBuildUuid = requestBuild(); } else { @@ -705,17 +705,15 @@ void DAPDebugger::handleEvents(const dpf::Event &event) } } else if (event.data() == debugger.prepareDebugProgress.name) { printOutput(event.property(debugger.prepareDebugProgress.pKeys[0]).toString()); - } else if (event.data() == project.activedProject.name) { - getActiveProjectInfo() = qvariant_cast(event.property(project.activedProject.pKeys[0])); - d->activeProjectKitName = getActiveProjectInfo().kitName(); - updateRunState(kNoRun); - } else if (event.data() == project.createdProject.name) { - getActiveProjectInfo() = qvariant_cast(event.property(project.createdProject.pKeys[0])); - d->activeProjectKitName = getActiveProjectInfo().kitName(); - updateRunState(kNoRun); + } else if (event.data() == project.activatedProject.name) { + d->projectInfo = qvariant_cast(event.property("projectInfo")); + d->activeProjectKitName = d->projectInfo.kitName(); } else if (event.data() == project.deletedProject.name) { - d->activeProjectKitName.clear(); - updateRunState(kNoRun); + auto prjInfo = event.property("projectInfo").value(); + if (d->projectInfo.isSame(prjInfo)) { + d->activeProjectKitName.clear(); + updateRunState(kNoRun); + } } else if (event.data() == editor.switchedFile.name) { QString filePath = event.property(editor.switchedFile.pKeys[0]).toString(); if (d->currentOpenedFileName != filePath) { @@ -1143,6 +1141,9 @@ void DAPDebugger::updateWatchingVariables() void DAPDebugger::exitDebug() { + //abort debugger + abortDebug(); + // Change UI. editor.removeDebugLine(); d->variablesPane->hide(); diff --git a/src/plugins/debugger/debugmanager.cpp b/src/plugins/debugger/debugmanager.cpp index 022453967..bc83fa188 100644 --- a/src/plugins/debugger/debugmanager.cpp +++ b/src/plugins/debugger/debugmanager.cpp @@ -200,8 +200,8 @@ void DebugManager::handleEvents(const dpf::Event &event) QString data = event.data().toString(); if (event.data() == debugger.prepareDebugProgress.name) { // TODO(logan) - } else if (event.data() == project.activedProject.name) { - auto projectInfo = qvariant_cast(event.property(project.activedProject.pKeys[0])); + } else if (event.data() == project.activatedProject.name) { + auto projectInfo = qvariant_cast(event.property(project.activatedProject.pKeys[0])); activeProjectKitName = projectInfo.kitName(); } else if (event.data() == project.createdProject.name) { auto projectInfo = qvariant_cast(event.property(project.createdProject.pKeys[0])); diff --git a/src/plugins/debugger/runner/runner.cpp b/src/plugins/debugger/runner/runner.cpp index 794fb0ad3..e23257be6 100644 --- a/src/plugins/debugger/runner/runner.cpp +++ b/src/plugins/debugger/runner/runner.cpp @@ -131,7 +131,7 @@ void Runner::handleEvents(const dpf::Event &event) if (d->currentOpenedFilePath == filePath) { d->currentOpenedFilePath.clear(); } - } else if (event.data() == project.activedProject.name) { + } else if (event.data() == project.activatedProject.name) { QVariant proInfoVar = event.property("projectInfo"); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); auto programs = projectInfo.exePrograms(); diff --git a/src/plugins/filebrowser/transceiver/filebrowserreceiver.cpp b/src/plugins/filebrowser/transceiver/filebrowserreceiver.cpp index 3d83fb0d4..c52ac383b 100644 --- a/src/plugins/filebrowser/transceiver/filebrowserreceiver.cpp +++ b/src/plugins/filebrowser/transceiver/filebrowserreceiver.cpp @@ -28,14 +28,14 @@ QStringList FileBrowserReceiver::topics() void FileBrowserReceiver::eventProcess(const dpf::Event &event) { - if (event.data() == project.activedProject.name) { - QVariant proInfoVar = event.property(project.activedProject.pKeys[0]); + if (event.data() == project.activatedProject.name) { + QVariant proInfoVar = event.property(project.activatedProject.pKeys[0]); dpfservice::ProjectInfo proInfo = qvariant_cast(proInfoVar); TreeViewKeeper::instance()->treeView()->setProjectInfo(proInfo); } else if (event.data() == project.deletedProject.name) { TreeViewKeeper::instance()->treeView()->setProjectInfo({}); } else if (event.data() == project.createdProject.name) { - QVariant proInfoVar = event.property(project.activedProject.pKeys[0]); + QVariant proInfoVar = event.property(project.activatedProject.pKeys[0]); dpfservice::ProjectInfo proInfo = qvariant_cast(proInfoVar); TreeViewKeeper::instance()->treeView()->setProjectInfo(proInfo); } diff --git a/src/plugins/git/transceiver/gitreceiver.cpp b/src/plugins/git/transceiver/gitreceiver.cpp index 36ca660a3..d2dc58ef7 100644 --- a/src/plugins/git/transceiver/gitreceiver.cpp +++ b/src/plugins/git/transceiver/gitreceiver.cpp @@ -17,7 +17,7 @@ GitReceiver::GitReceiver(QObject *parent) using namespace std::placeholders; eventHandleMap.insert(editor.switchedFile.name, std::bind(&GitReceiver::handleSwitchedFileEvent, this, _1)); eventHandleMap.insert(editor.contextMenu.name, std::bind(&GitReceiver::handleContextMenuEvent, this, _1)); - eventHandleMap.insert(project.activedProject.name, std::bind(&GitReceiver::handleProjectChangedEvent, this, _1)); + eventHandleMap.insert(project.activatedProject.name, std::bind(&GitReceiver::handleProjectChangedEvent, this, _1)); eventHandleMap.insert(project.deletedProject.name, std::bind(&GitReceiver::handleProjectChangedEvent, this, _1)); } diff --git a/src/plugins/project/transceiver/projectcorereceiver.cpp b/src/plugins/project/transceiver/projectcorereceiver.cpp index 18fba6917..66ef07c4c 100644 --- a/src/plugins/project/transceiver/projectcorereceiver.cpp +++ b/src/plugins/project/transceiver/projectcorereceiver.cpp @@ -31,9 +31,9 @@ void ProjectCoreReceiver::eventProcess(const dpf::Event &event) using namespace dpfservice; if (event.data() == project.activeProject.name) { auto infos = ProjectKeeper::instance()->treeView()->getAllProjectInfo(); - QString kitName = event.property(project.openProject.pKeys[0]).toString(); - QString language = event.property(project.openProject.pKeys[1]).toString(); - QString workspace = event.property(project.openProject.pKeys[2]).toString(); + QString kitName = event.property("kitName").toString(); + QString language = event.property("language").toString(); + QString workspace = event.property("workspace").toString(); ProjectKeeper::instance()->treeView()->activeProjectInfo(kitName, language, workspace); } else if (event.data() == project.openProject.name) { uiController.doSwitch(dpfservice::MWNA_EDIT); @@ -60,7 +60,7 @@ void ProjectCoreReceiver::eventProcess(const dpf::Event &event) ProjectKeeper::instance()->treeView()->expandAll(); } else if (event.data() == workspace.foldAll.name) { ProjectKeeper::instance()->treeView()->collapseAll(); - } else if (event.data() == project.activedProject.name) { + } else if (event.data() == project.activatedProject.name) { QVariant proInfoVar = event.property("projectInfo"); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); diff --git a/src/plugins/project/transceiver/sendevents.cpp b/src/plugins/project/transceiver/sendevents.cpp index 49fb22205..477a29369 100644 --- a/src/plugins/project/transceiver/sendevents.cpp +++ b/src/plugins/project/transceiver/sendevents.cpp @@ -8,7 +8,7 @@ void SendEvents::projectActived(const dpfservice::ProjectInfo &info) { - project.activedProject(info); + project.activatedProject(info); } void SendEvents::projectCreated(const dpfservice::ProjectInfo &info) diff --git a/src/plugins/symbol/transceiver/symbolreceiver.cpp b/src/plugins/symbol/transceiver/symbolreceiver.cpp index 8e318623e..d5575dee6 100644 --- a/src/plugins/symbol/transceiver/symbolreceiver.cpp +++ b/src/plugins/symbol/transceiver/symbolreceiver.cpp @@ -32,8 +32,8 @@ QStringList SymbolReceiver::topics() void SymbolReceiver::eventProcess(const dpf::Event &event) { - if (event.data() == project.activedProject.name) { - QString projectInfoKey = project.activedProject.pKeys[0]; + if (event.data() == project.activatedProject.name) { + QString projectInfoKey = project.activatedProject.pKeys[0]; dpfservice::ProjectInfo info = qvariant_cast (event.property(projectInfoKey)); QString workspace = info.workspaceFolder(); diff --git a/src/plugins/valgrind/mainframe/valgrindrunner.cpp b/src/plugins/valgrind/mainframe/valgrindrunner.cpp index 95527ddcc..d0d979328 100644 --- a/src/plugins/valgrind/mainframe/valgrindrunner.cpp +++ b/src/plugins/valgrind/mainframe/valgrindrunner.cpp @@ -24,7 +24,7 @@ class ValgrindRunnerPrivate QStringList ValgrindArgs; dpfservice::ProjectInfo projectInfo; - QString activedProjectKitName; + QString activatedProjectKitName; QString workingDir; QString currentFilePath; QString targetPath; @@ -73,7 +73,7 @@ void ValgrindRunner::initialize() }); }); - setActionsStatus(d->activedProjectKitName); + setActionsStatus(d->activatedProjectKitName); } void ValgrindRunner::runValgrind(const QString &type) @@ -157,13 +157,13 @@ void ValgrindRunner::setActionsStatus(const QString &kitName) void ValgrindRunner::saveCurrentProjectInfo(const ProjectInfo &projectInfo) { d->projectInfo = projectInfo; - d->activedProjectKitName = d->projectInfo.kitName(); - setActionsStatus(d->activedProjectKitName); + d->activatedProjectKitName = d->projectInfo.kitName(); + setActionsStatus(d->activatedProjectKitName); } void ValgrindRunner::removeProjectInfo() { - d->activedProjectKitName.clear(); + d->activatedProjectKitName.clear(); setActionsStatus(""); } @@ -182,7 +182,7 @@ void ValgrindRunner::runBuilding() auto &ctx = dpfInstance.serviceContext(); LanguageService *service = ctx.service(LanguageService::name()); if (service) { - auto generator = service->create(d->activedProjectKitName); + auto generator = service->create(d->activatedProjectKitName); if (generator) { if (generator->isNeedBuild()) { generator->build(d->projectInfo.workspaceFolder()); diff --git a/src/plugins/valgrind/transceiver/valgrindreceiver.cpp b/src/plugins/valgrind/transceiver/valgrindreceiver.cpp index c7a2e7ab9..cf85d45d1 100644 --- a/src/plugins/valgrind/transceiver/valgrindreceiver.cpp +++ b/src/plugins/valgrind/transceiver/valgrindreceiver.cpp @@ -30,8 +30,8 @@ QStringList ValgrindReceiver::topics() void ValgrindReceiver::eventProcess(const dpf::Event &event) { - if (event.data() == project.activedProject.name) { - QVariant proInfoVar = event.property(project.activedProject.pKeys[0]); + if (event.data() == project.activatedProject.name) { + QVariant proInfoVar = event.property(project.activatedProject.pKeys[0]); dpfservice::ProjectInfo projectInfo = qvariant_cast(proInfoVar); QString buildFolder = projectInfo.buildFolder(); ValgrindRunner::instance()->saveCurrentProjectInfo(projectInfo);