chore: fix typos in variable names and log messages

This commit is contained in:
Nick Bolton
2026-01-22 13:59:19 +00:00
committed by Chris Rizzitello
parent 1157bff34b
commit e7eb324f16
3 changed files with 6 additions and 6 deletions

View File

@ -106,7 +106,7 @@ std::string AppUtilUnix::getCurrentLanguageCode()
XkbStateRec 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 groupStartI = 0;
@ -118,7 +118,7 @@ std::string AppUtilUnix::getCurrentLanguageCode()
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("pc", 0, 2) == std::string::npos) {
if (nedeedGroupIndex == groupIdx) {
if (neededGroupIndex == groupIdx) {
result = group.substr(0, std::min(group.find('(', 0), group.find(':', 0)));
break;
}

View File

@ -867,18 +867,18 @@ void OSXKeyState::setGroup(int32_t group)
{
TISInputSourceRef keyboardLayout = (TISInputSourceRef)CFArrayGetValueAtIndex(m_groups.get(), group);
if (!keyboardLayout) {
LOG_WARN("nedeed keyboard layout is null");
LOG_WARN("needed keyboard layout is null");
return;
}
auto canBeSetted = (CFBooleanRef
)TISGetInputSourceProperty(TISCopyCurrentKeyboardInputSource(), kTISPropertyInputSourceIsEnableCapable);
if (!canBeSetted) {
LOG_WARN("nedeed keyboard layout is disabled for programmatically selection");
LOG_WARN("needed keyboard layout is disabled for programmatically selection");
return;
}
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);

View File

@ -108,7 +108,7 @@ private:
//! 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;