diff options
| author | Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> | 2025-05-31 23:49:50 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-31 19:49:50 +0100 |
| commit | 69c2b2926e128f1fd09080aed43944987a42026f (patch) | |
| tree | c92596715498f30ae33767d3c93268d4f01aec6f /src/managers/input/InputManager.cpp | |
| parent | 4078e1d17c0fb1439ee5a0ba1e539f06a8f47aab (diff) | |
internal: refactor to use empty() (#10599)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index cc0485d8..70f92023 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1082,7 +1082,7 @@ void CInputManager::applyConfigToKeyboard(SP<IKeyboard> pKeyboard) { pKeyboard->m_allowed = PERM == PERMISSION_RULE_ALLOW_MODE_ALLOW; try { - if (NUMLOCKON == pKeyboard->m_numlockOn && REPEATDELAY == pKeyboard->m_repeatDelay && REPEATRATE == pKeyboard->m_repeatRate && RULES != "" && + if (NUMLOCKON == pKeyboard->m_numlockOn && REPEATDELAY == pKeyboard->m_repeatDelay && REPEATRATE == pKeyboard->m_repeatRate && !RULES.empty() && RULES == pKeyboard->m_currentRules.rules && MODEL == pKeyboard->m_currentRules.model && LAYOUT == pKeyboard->m_currentRules.layout && VARIANT == pKeyboard->m_currentRules.variant && OPTIONS == pKeyboard->m_currentRules.options && FILEPATH == pKeyboard->m_xkbFilePath) { Debug::log(LOG, "Not applying config to keyboard, it did not change."); @@ -1205,7 +1205,7 @@ void CInputManager::setPointerConfigs() { libinput_device_config_middle_emulation_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); const auto TAP_MAP = g_pConfigManager->getDeviceString(devname, "tap_button_map", "input:touchpad:tap_button_map"); - if (TAP_MAP == "" || TAP_MAP == "lrm") + if (TAP_MAP.empty() || TAP_MAP == "lrm") libinput_device_config_tap_set_button_map(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_MAP_LRM); else if (TAP_MAP == "lmr") libinput_device_config_tap_set_button_map(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_MAP_LMR); @@ -1214,7 +1214,7 @@ void CInputManager::setPointerConfigs() { } const auto SCROLLMETHOD = g_pConfigManager->getDeviceString(devname, "scroll_method", "input:scroll_method"); - if (SCROLLMETHOD == "") { + if (SCROLLMETHOD.empty()) { libinput_device_config_scroll_set_method(LIBINPUTDEV, libinput_device_config_scroll_get_default_method(LIBINPUTDEV)); } else if (SCROLLMETHOD == "no_scroll") { libinput_device_config_scroll_set_method(LIBINPUTDEV, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); @@ -1330,7 +1330,7 @@ void CInputManager::destroyKeyboard(SP<IKeyboard> pKeyboard) { std::erase_if(m_keyboards, [pKeyboard](const auto& other) { return other == pKeyboard; }); - if (m_keyboards.size() > 0) { + if (!m_keyboards.empty()) { bool found = false; for (auto const& k : m_keyboards | std::views::reverse) { if (!k) @@ -1354,7 +1354,7 @@ void CInputManager::destroyPointer(SP<IPointer> mouse) { std::erase_if(m_pointers, [mouse](const auto& other) { return other == mouse; }); - g_pSeatManager->setMouse(m_pointers.size() > 0 ? m_pointers.front() : nullptr); + g_pSeatManager->setMouse(!m_pointers.empty() ? m_pointers.front() : nullptr); if (!g_pSeatManager->m_mouse.expired()) unconstrainMouse(); |
