MCPcopy Create free account
hub / github.com/KDE/falkon / match

Method match

src/plugins/GreaseMonkey/gm_script.cpp:179–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179bool GM_Script::match(const QUrl& url) const
180{
181 QString urlString = url.toString();
182
183 for (const auto &exclude : std::as_const(m_exclude)) {
184 QString wildcardExp = QRegularExpression::wildcardToRegularExpression(
185 exclude,
186 QRegularExpression::UnanchoredWildcardConversion
187 );
188 QRegularExpression re(wildcardExp,
189 QRegularExpression::CaseInsensitiveOption);
190
191 if (re.match(urlString).hasMatch()) {
192 return false;
193 }
194 }
195
196 for (const auto &include : std::as_const(m_include)) {
197 QString wildcardExp = QRegularExpression::wildcardToRegularExpression(
198 include,
199 QRegularExpression::UnanchoredWildcardConversion
200 );
201 QRegularExpression re(wildcardExp,
202 QRegularExpression::CaseInsensitiveOption);
203
204 if (re.match(urlString).hasMatch()) {
205 return true;
206 }
207 }
208
209 return false;
210}
211
212void GM_Script::watchedFileChanged(const QString &file)
213{

Callers 3

populateWebViewMenuMethod · 0.45
domainFromUrlMethod · 0.45
testMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected