forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user