MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / initializeKeyboardSwitch

Function initializeKeyboardSwitch

Telegram/SourceFiles/core/utils.cpp:470–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468QString engAlphabetUpper = engAlphabet.toUpper();
469
470void initializeKeyboardSwitch() {
471 if (fastRusKeyboardSwitch.isEmpty()) {
472 QString rusAlphabet = "йцукенгшщзхъфывапролджэячсмитьбю";
473 QString rusAlphabetUpper = rusAlphabet.toUpper();
474 for (int i = 0; i < rusAlphabet.size(); ++i) {
475 fastRusKeyboardSwitch.insert(engAlphabetUpper[i], rusAlphabetUpper[i]);
476 fastRusKeyboardSwitch.insert(engAlphabet[i], rusAlphabet[i]);
477 fastRusKeyboardSwitch.insert(rusAlphabetUpper[i], engAlphabetUpper[i]);
478 fastRusKeyboardSwitch.insert(rusAlphabet[i], engAlphabet[i]);
479 }
480 }
481 if (fastUkrKeyboardSwitch.isEmpty()) {
482 QString ukrAlphabet = "йцукенгшщзхїфівапролджєячсмитьбю";
483 QString ukrAlphabetUpper = ukrAlphabet.toUpper();
484 for (int i = 0; i < ukrAlphabet.size(); ++i) {
485 fastUkrKeyboardSwitch.insert(engAlphabetUpper[i], ukrAlphabetUpper[i]);
486 fastUkrKeyboardSwitch.insert(engAlphabet[i], ukrAlphabet[i]);
487 fastUkrKeyboardSwitch.insert(ukrAlphabetUpper[i], engAlphabetUpper[i]);
488 fastUkrKeyboardSwitch.insert(ukrAlphabet[i], engAlphabet[i]);
489 }
490 }
491}
492
493QString switchKeyboardLayout(const QString& from, QHash<QChar, QChar>& keyboardSwitch) {
494 QString result;

Callers 1

rusKeyboardLayoutSwitchFunction · 0.85

Calls 3

isEmptyMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected