From 05a1e22ed93afefb84b19bec05ed66d3de2e568b Mon Sep 17 00:00:00 2001 From: Moritz Gleissner Date: Sun, 9 Jun 2024 20:25:20 +0200 Subject: [PATCH] fixed typos * changed hasDescriptions to hasDescription --- src/config/ConfigManager.cpp | 30 +++++++++++++------------- src/debug/HyprCtl.cpp | 5 ++--- src/managers/KeybindManager.hpp | 38 ++++++++++++++++----------------- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index c30d251d4e6..1e65a87eea1 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1954,16 +1954,16 @@ std::optional CConfigManager::handleBind(const std::string& command // bind[fl]=SUPER,G,exec,dmenu_run // flags - bool locked = false; - bool release = false; - bool repeat = false; - bool mouse = false; - bool nonConsuming = false; - bool transparent = false; - bool ignoreMods = false; - bool multiKey = false; - bool has_description = false; - const auto BINDARGS = command.substr(4); + bool locked = false; + bool release = false; + bool repeat = false; + bool mouse = false; + bool nonConsuming = false; + bool transparent = false; + bool ignoreMods = false; + bool multiKey = false; + bool hasDescription = false; + const auto BINDARGS = command.substr(4); for (auto& arg : BINDARGS) { if (arg == 'l') { @@ -1983,7 +1983,7 @@ std::optional CConfigManager::handleBind(const std::string& command } else if (arg == 's') { multiKey = true; } else if (arg == 'd') { - has_description = true; + hasDescription = true; } else { return "bind: invalid flag"; } @@ -1995,10 +1995,10 @@ std::optional CConfigManager::handleBind(const std::string& command if (mouse && (repeat || release || locked)) return "flag m is exclusive"; - const int numbArgs = has_description ? 5 : 4; + const int numbArgs = hasDescription ? 5 : 4; const auto ARGS = CVarList(value, numbArgs); - const int DESCR_OFFSET = has_description ? 1 : 0; + const int DESCR_OFFSET = hasDescription ? 1 : 0; if ((ARGS.size() < 3 && !mouse) || (ARGS.size() < 3 && mouse)) return "bind: too few args"; else if ((ARGS.size() > (size_t)4 + DESCR_OFFSET && !mouse) || (ARGS.size() > (size_t)3 + DESCR_OFFSET && mouse)) @@ -2020,7 +2020,7 @@ std::optional CConfigManager::handleBind(const std::string& command const auto KEY = multiKey ? "" : ARGS[1]; - const auto DESCRIPTION = has_description ? ARGS[2] : ""; + const auto DESCRIPTION = hasDescription ? ARGS[2] : ""; auto HANDLER = ARGS[2 + DESCR_OFFSET]; @@ -2053,7 +2053,7 @@ std::optional CConfigManager::handleBind(const std::string& command } g_pKeybindManager->addKeybind(SKeybind{parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER, COMMAND, locked, m_szCurrentSubmap, DESCRIPTION, - release, repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, has_description}); + release, repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription}); } return {}; diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index f27770adef5..242369d643e 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -791,9 +791,8 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) { ret += "e"; if (kb.nonConsuming) ret += "n"; - if (kb.hasDescriptions) { + if (kb.hasDescription) ret += "d"; - } ret += std::format("\n\tmodmask: {}\n\tsubmap: {}\n\tkey: {}\n\tkeycode: {}\n\tcatchall: {}\n\tdescription: {}\n\tdispatcher: {}\n\targ: {}\n\n", kb.modmask, kb.submap, kb.key, kb.keycode, kb.catchAll, kb.description, kb.handler, kb.arg); @@ -821,7 +820,7 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) { "arg": "{}" }},)#", kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.nonConsuming ? "true" : "false", - kb.hasDescriptions ? "true" : "false", kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode, kb.catchAll ? "true" : "false", + kb.hasDescription ? "true" : "false", kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode, kb.catchAll ? "true" : "false", escapeJSONStrings(kb.description), escapeJSONStrings(kb.handler), escapeJSONStrings(kb.arg)); } trimTrailingComma(ret); diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index 49d41368d60..ecab6ee1af7 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -14,25 +14,25 @@ class CPluginSystem; class IKeyboard; struct SKeybind { - std::string key = ""; - std::set sMkKeys = {}; - uint32_t keycode = 0; - bool catchAll = false; - uint32_t modmask = 0; - std::set sMkMods = {}; - std::string handler = ""; - std::string arg = ""; - bool locked = false; - std::string submap = ""; - std::string description = ""; - bool release = false; - bool repeat = false; - bool mouse = false; - bool nonConsuming = false; - bool transparent = false; - bool ignoreMods = false; - bool multiKey = false; - bool hasDescriptions = false; + std::string key = ""; + std::set sMkKeys = {}; + uint32_t keycode = 0; + bool catchAll = false; + uint32_t modmask = 0; + std::set sMkMods = {}; + std::string handler = ""; + std::string arg = ""; + bool locked = false; + std::string submap = ""; + std::string description = ""; + bool release = false; + bool repeat = false; + bool mouse = false; + bool nonConsuming = false; + bool transparent = false; + bool ignoreMods = false; + bool multiKey = false; + bool hasDescription = false; // DO NOT INITIALIZE bool shadowed = false;