diff options
author | Eike Ziller <[email protected]> | 2013-07-09 12:14:33 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2013-07-12 11:58:24 +0200 |
commit | 871a8cd0319a4acfc7d4e4187596571bbf86e041 (patch) | |
tree | c61e3f54eb591ded80e4a8b49c3740175369a43d /src/plugins/debugger/debuggerplugin.cpp | |
parent | 354cd410b09091c1fe63b96388d49c60639b035f (diff) |
Work with documents instead of editors where possible in debugger
And where using editors is necessary, take *all* editors into account,
not a random set of what previously was called "original" editors (when
using splits).
Change-Id: Id6bbad08f3083b6744fc2edcf0b87ba504d3257b
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 92a9b02d21c..f501757be9c 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2119,29 +2119,26 @@ void DebuggerPluginPrivate::cleanupViews() if (!boolSetting(CloseBuffersOnExit)) return; - EditorManager *editorManager = EditorManager::instance(); - QTC_ASSERT(editorManager, return); - QList<IEditor *> toClose; - foreach (IEditor *editor, editorManager->openedEditors()) { - if (editor->property(Constants::OPENED_BY_DEBUGGER).toBool()) { - IDocument *doc = editor->document(); + QList<IDocument *> toClose; + foreach (IDocument *document, EditorManager::documentModel()->openedDocuments()) { + if (document->property(Constants::OPENED_BY_DEBUGGER).toBool()) { bool keepIt = true; - if (editor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) + if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) keepIt = false; - else if (doc->isModified()) + else if (document->isModified()) keepIt = true; - else if (doc->filePath().contains(_("qeventdispatcher"))) + else if (document->filePath().contains(_("qeventdispatcher"))) keepIt = false; else - keepIt = (editor == EditorManager::currentEditor()); + keepIt = (document == EditorManager::currentDocument()); if (keepIt) - editor->setProperty(Constants::OPENED_BY_DEBUGGER, false); + document->setProperty(Constants::OPENED_BY_DEBUGGER, false); else - toClose.append(editor); + toClose.append(document); } } - editorManager->closeEditors(toClose); + EditorManager::closeDocuments(toClose); } void DebuggerPluginPrivate::setBusyCursor(bool busy) |