diff options
author | hjk <hjk@qt.io> | 2018-08-23 16:39:23 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-08-29 09:38:38 +0000 |
commit | a68e8c5b699e2d40fbdb35f7e7a577a48db06b8b (patch) | |
tree | 7b751884b28af97f8842fc03509b163d2c05e6ac /src/plugins/debugger/breakhandler.cpp | |
parent | 37dbc7ba85621303655020906ef3a2befcf2c6a8 (diff) | |
download | qt-creator-a68e8c5b699e2d40fbdb35f7e7a577a48db06b8b.tar.gz |
Debugger: Move session load/restore handling
... to breakpoint and watchhandler.
More modular this way.
Change-Id: I4a45481fcc2bfde67b164bd7274fb7b2a12cb7ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/breakhandler.cpp')
-rw-r--r-- | src/plugins/debugger/breakhandler.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index d714ada70e..f34eebc568 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -40,6 +40,8 @@ #include <coreplugin/icore.h> #include <coreplugin/idocument.h> +#include <projectexplorer/session.h> + #include <texteditor/textmark.h> #include <texteditor/texteditor.h> @@ -69,6 +71,7 @@ #include <QMenu> using namespace Core; +using namespace ProjectExplorer; using namespace Utils; namespace Debugger { @@ -2391,6 +2394,12 @@ BreakpointManager::BreakpointManager() theBreakpointManager = this; setHeader({tr("Debuggee"), tr("Function"), tr("File"), tr("Line"), tr("Address"), tr("Condition"), tr("Ignore"), tr("Threads")}); + connect(SessionManager::instance(), &SessionManager::sessionLoaded, + this, &BreakpointManager::loadSessionData); + connect(SessionManager::instance(), &SessionManager::aboutToSaveSession, + this, &BreakpointManager::saveSessionData); + connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession, + this, &BreakpointManager::aboutToUnloadSession); } QAbstractItemModel *BreakpointManager::model() @@ -2755,20 +2764,20 @@ void BreakpointManager::saveSessionData() map.insert("message", params.message); list.append(map); }); - setSessionValue("Breakpoints", list); + SessionManager::setValue("Breakpoints", list); } void BreakpointManager::aboutToUnloadSession() { saveSessionData(); - theBreakpointManager->clear(); + clear(); } void BreakpointManager::loadSessionData() { - theBreakpointManager->clear(); + clear(); - const QVariant value = sessionValue("Breakpoints"); + const QVariant value = SessionManager::value("Breakpoints"); const QList<QVariant> list = value.toList(); for (const QVariant &var : list) { const QMap<QString, QVariant> map = var.toMap(); |