chore: fix typos in variable names and log messages
This commit is contained in:
parent
1157bff34b
commit
e7eb324f16
3 changed files with 6 additions and 6 deletions
|
|
@ -106,7 +106,7 @@ std::string AppUtilUnix::getCurrentLanguageCode()
|
||||||
|
|
||||||
XkbStateRec state;
|
XkbStateRec state;
|
||||||
XkbGetState(display, XkbUseCoreKbd, &state);
|
XkbGetState(display, XkbUseCoreKbd, &state);
|
||||||
auto nedeedGroupIndex = static_cast<int>(state.group);
|
auto neededGroupIndex = static_cast<int>(state.group);
|
||||||
|
|
||||||
size_t groupIdx = 0;
|
size_t groupIdx = 0;
|
||||||
size_t groupStartI = 0;
|
size_t groupStartI = 0;
|
||||||
|
|
@ -118,7 +118,7 @@ std::string AppUtilUnix::getCurrentLanguageCode()
|
||||||
if (auto group = rawLayouts.substr(groupStartI, strI - groupStartI);
|
if (auto group = rawLayouts.substr(groupStartI, strI - groupStartI);
|
||||||
group.find("group", 0, 5) == std::string::npos && group.find("inet", 0, 4) == std::string::npos &&
|
group.find("group", 0, 5) == std::string::npos && group.find("inet", 0, 4) == std::string::npos &&
|
||||||
group.find("pc", 0, 2) == std::string::npos) {
|
group.find("pc", 0, 2) == std::string::npos) {
|
||||||
if (nedeedGroupIndex == groupIdx) {
|
if (neededGroupIndex == groupIdx) {
|
||||||
result = group.substr(0, std::min(group.find('(', 0), group.find(':', 0)));
|
result = group.substr(0, std::min(group.find('(', 0), group.find(':', 0)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -867,18 +867,18 @@ void OSXKeyState::setGroup(int32_t group)
|
||||||
{
|
{
|
||||||
TISInputSourceRef keyboardLayout = (TISInputSourceRef)CFArrayGetValueAtIndex(m_groups.get(), group);
|
TISInputSourceRef keyboardLayout = (TISInputSourceRef)CFArrayGetValueAtIndex(m_groups.get(), group);
|
||||||
if (!keyboardLayout) {
|
if (!keyboardLayout) {
|
||||||
LOG_WARN("nedeed keyboard layout is null");
|
LOG_WARN("needed keyboard layout is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto canBeSetted = (CFBooleanRef
|
auto canBeSetted = (CFBooleanRef
|
||||||
)TISGetInputSourceProperty(TISCopyCurrentKeyboardInputSource(), kTISPropertyInputSourceIsEnableCapable);
|
)TISGetInputSourceProperty(TISCopyCurrentKeyboardInputSource(), kTISPropertyInputSourceIsEnableCapable);
|
||||||
if (!canBeSetted) {
|
if (!canBeSetted) {
|
||||||
LOG_WARN("nedeed keyboard layout is disabled for programmatically selection");
|
LOG_WARN("needed keyboard layout is disabled for programmatically selection");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TISSelectInputSource(keyboardLayout) != noErr) {
|
if (TISSelectInputSource(keyboardLayout) != noErr) {
|
||||||
LOG_WARN("failed to set nedeed keyboard layout");
|
LOG_WARN("failed to set needed keyboard layout");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG1("keyboard layout change to %d", group);
|
LOG_DEBUG1("keyboard layout change to %d", group);
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ private:
|
||||||
|
|
||||||
//! Create and send language change request to \p group by DBus interface
|
//! Create and send language change request to \p group by DBus interface
|
||||||
/*!
|
/*!
|
||||||
Returns the existance of nedeed DBus interface.
|
Returns the existence of needed DBus interface.
|
||||||
*/
|
*/
|
||||||
bool setCurrentLanguageWithDBus(int32_t group) const;
|
bool setCurrentLanguageWithDBus(int32_t group) const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue