| 491 | } |
| 492 | |
| 493 | QString switchKeyboardLayout(const QString& from, QHash<QChar, QChar>& keyboardSwitch) { |
| 494 | QString result; |
| 495 | result.reserve(from.size()); |
| 496 | for (QString::const_iterator i = from.cbegin(), e = from.cend(); i != e; ++i) { |
| 497 | QHash<QChar, QChar>::const_iterator j = keyboardSwitch.constFind(*i); |
| 498 | if (j == keyboardSwitch.cend()) { |
| 499 | result += *i; |
| 500 | } else { |
| 501 | result += j.value(); |
| 502 | } |
| 503 | } |
| 504 | return result; |
| 505 | } |
| 506 | |
| 507 | QString rusKeyboardLayoutSwitch(const QString& from) { |
| 508 | initializeKeyboardSwitch(); |
no test coverage detected