diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-01-21 14:29:25 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-01-24 08:00:28 +0100 |
commit | c99464dd9b9af759d4524eab52eb603a49d82bd4 (patch) | |
tree | d22d0113b0feecf743f50ccf4369e36943eb6c86 /src/plugins/qmljseditor | |
parent | 13ee70652c79c976d0622afd18490cf66ecf43b0 (diff) |
TextEditors: Remove unnecessary duplicated caching
Change-Id: I3800360e3b9bd6874d6852dabcfc7a9a066e52c2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r-- | src/plugins/qmljseditor/qmljseditor.cpp | 18 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljseditor.h | 3 |
2 files changed, 2 insertions, 19 deletions
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 7fca13f0374..01e61f605b7 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -860,7 +860,7 @@ void QmlJSTextEditorWidget::updateUsesNow() continue; QTextEdit::ExtraSelection sel; - sel.format = m_occurrencesFormat; + sel.format = baseTextDocument()->fontSettings().toTextCharFormat(TextEditor::C_OCCURRENCES); sel.cursor = textCursor(); sel.cursor.setPosition(loc.begin()); sel.cursor.setPosition(loc.end(), QTextCursor::KeepAnchor); @@ -1000,21 +1000,7 @@ void QmlJSTextEditorWidget::setSelectedElements() void QmlJSTextEditorWidget::applyFontSettings() { TextEditor::BaseTextEditorWidget::applyFontSettings(); - - const TextEditor::FontSettings &fs = baseTextDocument()->fontSettings(); - m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES); - m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED); - m_occurrencesUnusedFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline); - m_occurrencesUnusedFormat.setUnderlineColor(m_occurrencesUnusedFormat.foreground().color()); - m_occurrencesUnusedFormat.clearForeground(); - m_occurrencesUnusedFormat.setToolTip(tr("Unused variable")); - m_occurrenceRenameFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_RENAME); - - // only set the background, we do not want to modify foreground properties set by the syntax highlighter or the link - m_occurrencesFormat.clearForeground(); - m_occurrenceRenameFormat.clearForeground(); - - m_semanticHighlighter->updateFontSettings(fs); + m_semanticHighlighter->updateFontSettings(baseTextDocument()->fontSettings()); } diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 669bfa2ba84..851a244665d 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -198,9 +198,6 @@ private: Internal::QmlOutlineModel *m_outlineModel; QModelIndex m_outlineModelIndex; QmlJS::ModelManagerInterface *m_modelManager; - QTextCharFormat m_occurrencesFormat; - QTextCharFormat m_occurrencesUnusedFormat; - QTextCharFormat m_occurrenceRenameFormat; Internal::SemanticInfoUpdater *m_semanticInfoUpdater; QmlJSTools::SemanticInfo m_semanticInfo; |