Changeset View
Changeset View
Standalone View
Standalone View
src/indexer/katehighlightingindexer.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 41 | { | |||
---|---|---|---|---|---|
64 | return listing; | 64 | return listing; | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | /** | 67 | /** | ||
68 | * check if the "extensions" attribute have valid wildcards | 68 | * check if the "extensions" attribute have valid wildcards | ||
69 | * @param extensions extensions string to check | 69 | * @param extensions extensions string to check | ||
70 | * @return valid? | 70 | * @return valid? | ||
71 | */ | 71 | */ | ||
72 | bool checkExtensions(QString extensions) | 72 | bool checkExtensions(const QString &extensions) | ||
73 | { | 73 | { | ||
74 | // get list of extensions | 74 | // get list of extensions | ||
75 | const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts); | 75 | const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts); | ||
76 | 76 | | |||
77 | // ok if empty | 77 | // ok if empty | ||
78 | if (extensionParts.isEmpty()) { | 78 | if (extensionParts.isEmpty()) { | ||
79 | return true; | 79 | return true; | ||
80 | } | 80 | } | ||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Line(s) | |||||
323 | }; | 323 | }; | ||
324 | 324 | | |||
325 | /** | 325 | /** | ||
326 | * Helper class to search for non-existing contexts and invalid version | 326 | * Helper class to search for non-existing contexts and invalid version | ||
327 | */ | 327 | */ | ||
328 | class ContextChecker | 328 | class ContextChecker | ||
329 | { | 329 | { | ||
330 | public: | 330 | public: | ||
331 | void setKateVersion(QStringRef verStr, const QString &hlFilename, const QString &hlName) | 331 | void setKateVersion(const QStringRef &verStr, const QString &hlFilename, const QString &hlName) | ||
332 | { | 332 | { | ||
333 | const auto idx = verStr.indexOf(QLatin1Char('.')); | 333 | const auto idx = verStr.indexOf(QLatin1Char('.')); | ||
334 | if (idx <= 0) { | 334 | if (idx <= 0) { | ||
335 | qWarning() << hlFilename << "invalid kateversion" << verStr; | 335 | qWarning() << hlFilename << "invalid kateversion" << verStr; | ||
336 | m_success = false; | 336 | m_success = false; | ||
337 | } else { | 337 | } else { | ||
338 | auto &language = m_contextMap[hlName]; | 338 | auto &language = m_contextMap[hlName]; | ||
339 | language.version = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()}; | 339 | language.version = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()}; | ||
▲ Show 20 Lines • Show All 429 Lines • Show Last 20 Lines |