debugger: close source file of main event loop on debugger exit

When opened by the debugger, but even if it is the "current".
This hits the expected behaviour more often.

Change-Id: Iaa488f350791473ecd4b10b43c90223411cf5217
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-06-12 13:29:37 +02:00
committed by hjk
parent 1f3f726280
commit bdd09dd2b6

View File

@@ -2186,15 +2186,21 @@ void DebuggerPluginPrivate::cleanupViews()
QList<IEditor *> toClose;
foreach (IEditor *editor, editorManager->openedEditors()) {
if (editor->property(Constants::OPENED_BY_DEBUGGER).toBool()) {
// Close disassembly views. Close other opened files
// if they are not modified and not current editor.
if (editor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()
|| (!editor->document()->isModified()
&& editor != EditorManager::currentEditor())) {
toClose.append(editor);
} else {
IDocument *doc = editor->document();
bool keepIt = true;
if (editor->property(Constants::OPENED_WITH_DISASSEMBLY).toBool())
keepIt = false;
else if (doc->isModified())
keepIt = true;
else if (doc->fileName().contains(_("qeventdispatcher")))
keepIt = false;
else
keepIt = (editor == EditorManager::currentEditor());
if (keepIt)
editor->setProperty(Constants::OPENED_BY_DEBUGGER, false);
}
else
toClose.append(editor);
}
}
editorManager->closeEditors(toClose);