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

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 <>
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())) {
} 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;
keepIt = (editor == EditorManager::currentEditor());
if (keepIt)
editor->setProperty(Constants::OPENED_BY_DEBUGGER, false);
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