MCPcopy Create free account
hub / github.com/Sonic-DE/sonic-win / matchClientMachine

Method matchClientMachine

src/rules.cpp:421–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421bool Rules::matchClientMachine(const QString &match_machine, bool local) const
422{
423 if (clientmachinematch != UnimportantMatch) {
424 // if it's localhost, check also "localhost" before checking hostname
425 if (match_machine != "localhost" && local
426 && matchClientMachine("localhost", true)) {
427 return true;
428 }
429 if (clientmachinematch == RegExpMatch
430 && !QRegularExpression(clientmachine).match(match_machine).hasMatch()) {
431 return false;
432 }
433 if (clientmachinematch == ExactMatch
434 && clientmachine != match_machine) {
435 return false;
436 }
437 if (clientmachinematch == SubstringMatch
438 && !match_machine.contains(clientmachine)) {
439 return false;
440 }
441 }
442 return true;
443}
444
445#ifndef KCMRULES
446bool Rules::match(const Window *c) const

Callers 1

Calls 2

matchMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected