Beautifier: Fix Qt4 compile.

Change-Id: Ifbd01628b28abe6879d30d43f8bd1f389988086f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
David Schulz
2014-02-18 08:32:38 +01:00
parent 3d1f07c023
commit def888d13a
7 changed files with 27 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ void ConfigurationSyntaxHighlighter::setKeywords(const QStringList &keywords)
for (int i = 0, total = keywords.count(); i < total; ++i)
pattern << QRegExp::escape(keywords.at(i));
m_expressionKeyword.setPattern(QLatin1String("(?:\\s|^)(") + pattern.join(QLatin1Char('|'))
m_expressionKeyword.setPattern(QLatin1String("(?:\\s|^)(") + pattern.join(QLatin1String("|"))
+ QLatin1String(")(?=\\s|\\:|\\=|\\,|$)"));
}
@@ -120,7 +120,11 @@ void ConfigurationEditor::setSettings(AbstractSettings *settings)
QStringList keywords = m_settings->options();
m_highlighter->setKeywords(keywords);
keywords << m_settings->completerWords();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
keywords.sort(Qt::CaseInsensitive);
#else //QT_VERSION_CHECK(5, 0, 0)
keywords.sort();
#endif //QT_VERSION_CHECK(5, 0, 0)
m_model->setStringList(keywords);
}