Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/interfaces/abbreviations.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 124 | if ( word.size() == 0 ) { | |||
---|---|---|---|---|---|
125 | return true; | 125 | return true; | ||
126 | } | 126 | } | ||
127 | int lastSpace = 0; | 127 | int lastSpace = 0; | ||
128 | int matchedFragments = 0; | 128 | int matchedFragments = 0; | ||
129 | for ( int i = 0; i < word.size(); i++ ) { | 129 | for ( int i = 0; i < word.size(); i++ ) { | ||
130 | const QChar& c = word.at(i); | 130 | const QChar& c = word.at(i); | ||
131 | bool isDoubleColon = false; | 131 | bool isDoubleColon = false; | ||
132 | // if it's not a separation char, walk over it. | 132 | // if it's not a separation char, walk over it. | ||
133 | if ( c != ' ' && c != '/' && i != word.size() - 1 ) { | 133 | if (c != QLatin1Char(' ') && c != QLatin1Char('/') && i != word.size() - 1) { | ||
134 | if ( c != ':' && i < word.size()-1 && word.at(i+1) != ':' ) { | 134 | if (c != QLatin1Char(':') && i < word.size()-1 && word.at(i+1) != QLatin1Char(':')) { | ||
135 | continue; | 135 | continue; | ||
136 | } | 136 | } | ||
137 | isDoubleColon = true; | 137 | isDoubleColon = true; | ||
138 | i++; | 138 | i++; | ||
139 | } | 139 | } | ||
140 | // if it's '/', ' ' or '::', split the word here and check the next sub-word. | 140 | // if it's '/', ' ' or '::', split the word here and check the next sub-word. | ||
141 | const QStringRef wordFragment = word.midRef(lastSpace, i-lastSpace); | 141 | const QStringRef wordFragment = word.midRef(lastSpace, i-lastSpace); | ||
142 | const QString& typedFragment = typedFragments.at(matchedFragments); | 142 | const QString& typedFragment = typedFragments.at(matchedFragments); | ||
Show All 13 Lines |