forked from qt-creator/qt-creator
Python: Reset editor info bars when closing document
Fixes crash after reopening a python document and configuring the python language server in the reopend document. Change-Id: I42eb6c5d3ccb755a836fd9071b3147d65c8c0ab6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "pythonrunconfiguration.h"
|
||||
#include "pythonsettings.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/infobar.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
@@ -446,7 +447,16 @@ void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *docume
|
||||
|
||||
PyLSConfigureAssistant::PyLSConfigureAssistant(QObject *parent)
|
||||
: QObject(parent)
|
||||
{}
|
||||
{
|
||||
Core::EditorManager::instance();
|
||||
connect(Core::EditorManager::instance(),
|
||||
&Core::EditorManager::documentClosed,
|
||||
this,
|
||||
[this](Core::IDocument *document) {
|
||||
if (auto textDocument = qobject_cast<TextEditor::TextDocument *>(document))
|
||||
resetEditorInfoBar(textDocument);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Python
|
||||
|
Reference in New Issue
Block a user