Commit bdd09dd2 authored by hjk's avatar hjk Committed by hjk

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: default avatarhjk <qthjk@ovi.com>
parent 1f3f7262
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment