Changeset View
Changeset View
Standalone View
Standalone View
src/lib/keywordlist_p.h
Show All 21 Lines | |||||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #ifndef KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H | 24 | #ifndef KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H | ||
25 | #define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H | 25 | #define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H | ||
26 | 26 | | |||
27 | #include <QSet> | 27 | #include <QSet> | ||
28 | #include <QString> | 28 | #include <QString> | ||
29 | #include <QVector> | 29 | #include <QVector> | ||
30 | #include <QStringList> | ||||
30 | 31 | | |||
31 | #include <vector> | 32 | #include <vector> | ||
32 | 33 | | |||
33 | QT_BEGIN_NAMESPACE | 34 | QT_BEGIN_NAMESPACE | ||
34 | class QXmlStreamReader; | 35 | class QXmlStreamReader; | ||
35 | QT_END_NAMESPACE | 36 | QT_END_NAMESPACE | ||
36 | 37 | | |||
37 | namespace KSyntaxHighlighting { | 38 | namespace KSyntaxHighlighting { | ||
Show All 17 Lines | 55 | { | |||
55 | return m_name; | 56 | return m_name; | ||
56 | } | 57 | } | ||
57 | 58 | | |||
58 | const QStringList &keywords() const | 59 | const QStringList &keywords() const | ||
59 | { | 60 | { | ||
60 | return m_keywords; | 61 | return m_keywords; | ||
61 | } | 62 | } | ||
62 | 63 | | |||
64 | void setKeywordList(const QStringList& keywords) | ||||
65 | { | ||||
66 | m_keywords = keywords; | ||||
67 | m_keywordsSortedCaseSensitive.clear(); | ||||
68 | m_keywordsSortedCaseInsensitive.clear(); | ||||
69 | initLookupForCaseSensitivity(m_caseSensitive); | ||||
70 | } | ||||
71 | | ||||
63 | /** Checks if @p str is a keyword in this list. */ | 72 | /** Checks if @p str is a keyword in this list. */ | ||
64 | bool contains(const QStringRef &str) const | 73 | bool contains(const QStringRef &str) const | ||
sirgienko: Not sure about this realization, I think, we could modify it without lookuping all data. | |||||
65 | { | 74 | { | ||
66 | return contains(str, m_caseSensitive); | 75 | return contains(str, m_caseSensitive); | ||
67 | } | 76 | } | ||
68 | 77 | | |||
69 | /** Checks if @p str is a keyword in this list, overriding the global case-sensitivity setting. */ | 78 | /** Checks if @p str is a keyword in this list, overriding the global case-sensitivity setting. */ | ||
70 | bool contains(const QStringRef &str, Qt::CaseSensitivity caseSensitive) const; | 79 | bool contains(const QStringRef &str, Qt::CaseSensitivity caseSensitive) const; | ||
71 | 80 | | |||
72 | void load(QXmlStreamReader &reader); | 81 | void load(QXmlStreamReader &reader); | ||
Show All 38 Lines |
Not sure about this realization, I think, we could modify it without lookuping all data.