aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2014-11-17 10:19:18 +0100
committerhjk <[email protected]>2014-11-17 11:45:09 +0100
commit1b31e8eebd247624b88714779ee6331af7e1106b (patch)
tree8014c0e792335458da7d47fcf8089952ee597454 /src/plugins/debugger/debuggerplugin.cpp
parent4c614d970b1dbf55256f075842d68602e12ecc99 (diff)
Debugger: Introduce "Close memory buffers on exit" option
The usual case is probably to want normal editors stay open, but memory/diassembler removed, but all other combinations may be useful at times. So use two options instead of one. Change-Id: I58c3951cc507c7e66a8d7a65b459a036e6a5d801 Reviewed-by: Christian Stenger <[email protected]> Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 92d263944ae..7cf5b79d70e 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1982,21 +1982,22 @@ void DebuggerPluginPrivate::cleanupViews()
m_reverseDirectionAction->setChecked(false);
m_reverseDirectionAction->setEnabled(false);
- if (!boolSetting(CloseBuffersOnExit))
- return;
+ const bool closeSource = boolSetting(CloseSourceBuffersOnExit);
+ const bool closeMemory = boolSetting(CloseMemoryBuffersOnExit);
QList<IDocument *> toClose;
foreach (IDocument *document, DocumentModel::openedDocuments()) {
+ const bool isMemory = document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool();
if (document->property(Constants::OPENED_BY_DEBUGGER).toBool()) {
bool keepIt = true;
- if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool())
- keepIt = false;
- else if (document->isModified())
+ if (document->isModified())
keepIt = true;
else if (document->filePath().contains(_("qeventdispatcher")))
keepIt = false;
+ else if (isMemory)
+ keepIt = !closeMemory;
else
- keepIt = (document == EditorManager::currentDocument());
+ keepIt = !closeSource;
if (keepIt)
document->setProperty(Constants::OPENED_BY_DEBUGGER, false);