Commit 43a2c5dd authored by hjk's avatar hjk

TextEditor: Make sure "global" connections are properly destroyed

Task-number: QTCREATORBUG-13054
Change-Id: I32234836dc893075978dbc5fe43d696bc0f228f4
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent f0e2708d
......@@ -310,6 +310,8 @@ public:
void _q_animateUpdate(int position, QPointF lastPos, QRectF rect);
void updateCodeFoldingVisible();
void reconfigure();
public:
BaseTextEditorWidget *q;
QToolBar *m_toolBar;
......@@ -2709,6 +2711,11 @@ void BaseTextEditorWidgetPrivate::updateCodeFoldingVisible()
}
}
void BaseTextEditorWidgetPrivate::reconfigure()
{
q->configureMimeType(MimeDatabase::findByFile(m_document->filePath()));
}
bool BaseTextEditorWidget::codeFoldingVisible() const
{
return d->m_codeFoldingVisible;
......@@ -7154,15 +7161,11 @@ void BaseTextEditorWidget::setupAsPlainEditor()
textDocument()->setMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
auto reconf = [this]() {
MimeType mimeType;
if (textDocument())
mimeType = MimeDatabase::findByFile(textDocument()->filePath());
configureMimeType(mimeType);
};
connect(textDocument(), &IDocument::filePathChanged,
d, &BaseTextEditorWidgetPrivate::reconfigure);
connect(textDocument(), &IDocument::filePathChanged, reconf);
connect(Manager::instance(), &Manager::mimeTypesRegistered, reconf);
connect(Manager::instance(), &Manager::mimeTypesRegistered,
d, &BaseTextEditorWidgetPrivate::reconfigure);
updateEditorInfoBar(this);
}
......
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