managers: refactor class member vars (#10242)

This commit is contained in:
davc0n 2025-05-02 17:07:20 +02:00 committed by GitHub
parent 6f174a9e08
commit ce821294e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 930 additions and 932 deletions

View file

@ -866,7 +866,7 @@ static std::string globalShortcutsRequest(eHyprCtlOutputFormat format, std::stri
static std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) {
std::string ret = "";
if (format == eHyprCtlOutputFormat::FORMAT_NORMAL) {
for (auto const& kb : g_pKeybindManager->m_vKeybinds) {
for (auto const& kb : g_pKeybindManager->m_keybinds) {
ret += "bind";
if (kb->locked)
ret += "l";
@ -887,7 +887,7 @@ static std::string bindsRequest(eHyprCtlOutputFormat format, std::string request
} else {
// json
ret += "[";
for (auto const& kb : g_pKeybindManager->m_vKeybinds) {
for (auto const& kb : g_pKeybindManager->m_keybinds) {
ret += std::format(
R"#(
{{
@ -1076,8 +1076,8 @@ static std::string dispatchRequest(eHyprCtlOutputFormat format, std::string in)
if ((int)in.find_first_of(' ') != -1)
DISPATCHARG = in.substr(in.find_first_of(' ') + 1);
const auto DISPATCHER = g_pKeybindManager->m_mDispatchers.find(DISPATCHSTR);
if (DISPATCHER == g_pKeybindManager->m_mDispatchers.end())
const auto DISPATCHER = g_pKeybindManager->m_dispatchers.find(DISPATCHSTR);
if (DISPATCHER == g_pKeybindManager->m_dispatchers.end())
return "Invalid dispatcher";
SDispatchResult res = DISPATCHER->second(DISPATCHARG);
@ -1352,7 +1352,7 @@ static std::string dispatchSeterror(eHyprCtlOutputFormat format, std::string req
}
static std::string dispatchSetProp(eHyprCtlOutputFormat format, std::string request) {
auto result = g_pKeybindManager->m_mDispatchers["setprop"](request.substr(request.find_first_of(' ') + 1));
auto result = g_pKeybindManager->m_dispatchers["setprop"](request.substr(request.find_first_of(' ') + 1));
return "DEPRECATED: use hyprctl dispatch setprop instead" + (result.success ? "" : "\n" + result.error);
}