Changeset View
Changeset View
Standalone View
Standalone View
src/urifilters/shorturi/kshorturifilter.cpp
Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Line(s) | 420 | if (!isMalformed && !isLocalFullPath && !protocol.isEmpty()) { | |||
---|---|---|---|---|---|
430 | } | 430 | } | ||
431 | } | 431 | } | ||
432 | 432 | | |||
433 | // Short url matches | 433 | // Short url matches | ||
434 | if (!cmd.contains(QLatin1Char(' '))) { | 434 | if (!cmd.contains(QLatin1Char(' '))) { | ||
435 | // Okay this is the code that allows users to supply custom matches for | 435 | // Okay this is the code that allows users to supply custom matches for | ||
436 | // specific URLs using Qt's regexp class. This is hard-coded for now. | 436 | // specific URLs using Qt's regexp class. This is hard-coded for now. | ||
437 | // TODO: Make configurable at some point... | 437 | // TODO: Make configurable at some point... | ||
438 | Q_FOREACH (const URLHint &hint, m_urlHints) { | 438 | for (const URLHint &hint : qAsConst(m_urlHints)) { | ||
439 | qCDebug(category) << "testing regexp for" << hint.prepend; | 439 | qCDebug(category) << "testing regexp for" << hint.prepend; | ||
440 | if (hint.regexp.indexIn(cmd) == 0) { | 440 | if (hint.regexp.indexIn(cmd) == 0) { | ||
441 | const QString cmdStr = hint.prepend + cmd; | 441 | const QString cmdStr = hint.prepend + cmd; | ||
442 | QUrl url(cmdStr); | 442 | QUrl url(cmdStr); | ||
443 | qCDebug(category) << "match - prepending" << hint.prepend << "->" << cmdStr << "->" << url; | 443 | qCDebug(category) << "match - prepending" << hint.prepend << "->" << cmdStr << "->" << url; | ||
444 | setFilteredUri(data, url); | 444 | setFilteredUri(data, url); | ||
445 | setUriType(data, hint.type); | 445 | setUriType(data, hint.type); | ||
446 | return true; | 446 | return true; | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |