improve static initializers

Change-Id: I304fdd6627f01fc216c84930da607127c52409d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tim Jenssen
2016-09-23 15:46:41 +02:00
parent 669d04a686
commit d915b22db9
15 changed files with 119 additions and 146 deletions

View File

@@ -155,15 +155,14 @@ DiffAndLogHighlighter::DiffAndLogHighlighter(const QRegExp &filePattern, const Q
TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(0)),
d(new DiffAndLogHighlighterPrivate(this, filePattern, changePattern))
{
static QVector<TextEditor::TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_TEXT
<< TextEditor::C_ADDED_LINE
<< TextEditor::C_REMOVED_LINE
<< TextEditor::C_DIFF_FILE
<< TextEditor::C_DIFF_LOCATION
<< TextEditor::C_LOG_CHANGE_LINE;
}
static const QVector<TextEditor::TextStyle> categories({
TextEditor::C_TEXT,
TextEditor::C_ADDED_LINE,
TextEditor::C_REMOVED_LINE,
TextEditor::C_DIFF_FILE,
TextEditor::C_DIFF_LOCATION,
TextEditor::C_LOG_CHANGE_LINE
});
setTextFormatCategories(categories);
d->updateOtherFormats();
}