Debugger: Fix switching to previous mode on exit

This behavior was broken with refactoring done in commit
3b5ecac238. This has two main components:
1. Perspective::select() needs to call EngineManager::activateDebugMode()
   in order to save the previous mode.
2. The contents of the previous function
   DebuggerPluginPrivate::activatePreviousMode() was placed in
   EngineManager::deactivateDebugMode() and is called in
   doFinishDebugger().

Task-number: QTCREATORBUG-21415
Change-Id: Ibca188ba740027769c497e25ea695af8e218ea4e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Aaron Barany
2018-12-08 00:01:42 -08:00
parent 77ad54a6ef
commit 867befc5ae
4 changed files with 17 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
#include "debuggermainwindow.h"
#include "debuggerconstants.h"
#include "debuggerinternalconstants.h"
#include "enginemanager.h"
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -696,7 +697,7 @@ void Perspective::addWindow(QWidget *widget,
void Perspective::select()
{
ModeManager::activateMode(Debugger::Constants::MODE_DEBUG);
Debugger::Internal::EngineManager::activateDebugMode();
if (Perspective::currentPerspective() == this)
return;
theMainWindow->d->selectPerspective(this);