Highlighter: update all editors after downloading additional definitions

Instead of just the editor with the info bar that was triggering the
download action or none editor if the action was triggered from the
settings dialog.

Change-Id: I4158eeb7fdb0a763d082c6d801b400e8635c7f38
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-11-04 10:08:08 +01:00
parent 5ece12d4ea
commit 2c112a51c3
2 changed files with 2 additions and 4 deletions

View File

@@ -260,6 +260,7 @@ void Highlighter::downloadDefinitions(std::function<void()> callback) {
Core::MessageManager::write(tr("Highlighter updates: done"), Core::MessageManager::write(tr("Highlighter updates: done"),
Core::MessageManager::ModeSwitch); Core::MessageManager::ModeSwitch);
downloader->deleteLater(); downloader->deleteLater();
reload();
if (callback) if (callback)
callback(); callback();
}); });

View File

@@ -3104,10 +3104,7 @@ void TextEditorWidgetPrivate::updateSyntaxInfoBar(const Highlighter::Definitions
InfoBarEntry::GlobalSuppression::Enabled); InfoBarEntry::GlobalSuppression::Enabled);
info.setCustomButtonInfo(BaseTextEditor::tr("Download Definitions"), [missing, this]() { info.setCustomButtonInfo(BaseTextEditor::tr("Download Definitions"), [missing, this]() {
m_document->infoBar()->removeInfo(missing); m_document->infoBar()->removeInfo(missing);
Highlighter::downloadDefinitions([widget = QPointer<TextEditorWidget>(q)]() { Highlighter::downloadDefinitions();
if (widget)
widget->configureGenericHighlighter();
});
}); });
infoBar->removeInfo(multiple); infoBar->removeInfo(multiple);