| 419 | } |
| 420 | |
| 421 | bool 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 |
| 446 | bool Rules::match(const Window *c) const |
no test coverage detected