forked from qt-creator/qt-creator
Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance
Amends: b2a766a79a
Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py
Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -220,7 +220,7 @@ void ClangAssistProposalItem::apply(TextDocumentManipulatorInterface &manipulato
|
||||
textToBeInserted.chop(2);
|
||||
} else if (!ccr.text.isEmpty()) {
|
||||
const CompletionSettings &completionSettings =
|
||||
TextEditorSettings::instance()->completionSettings();
|
||||
TextEditorSettings::completionSettings();
|
||||
const bool autoInsertBrackets = completionSettings.m_autoInsertBrackets;
|
||||
|
||||
if (autoInsertBrackets &&
|
||||
|
||||
@@ -156,7 +156,7 @@ void addWarningSelections(const QVector<ClangBackEnd::DiagnosticContainer> &diag
|
||||
QTextDocument *textDocument,
|
||||
QList<QTextEdit::ExtraSelection> &extraSelections)
|
||||
{
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::fontSettings();
|
||||
|
||||
QTextCharFormat warningFormat = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
|
||||
|
||||
@@ -169,7 +169,7 @@ void addErrorSelections(const QVector<ClangBackEnd::DiagnosticContainer> &diagno
|
||||
QTextDocument *textDocument,
|
||||
QList<QTextEdit::ExtraSelection> &extraSelections)
|
||||
{
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::fontSettings();
|
||||
|
||||
QTextCharFormat errorFormat = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
|
||||
QTextCharFormat errorContextFormat = fontSettings.toTextCharFormat(TextEditor::C_ERROR_CONTEXT);
|
||||
|
||||
Reference in New Issue
Block a user