summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorPhilip Damianik <39028343+pdamianik@users.noreply.github.com>2023-09-06 21:45:37 +0200
committerGitHub <noreply@github.com>2023-09-06 21:45:37 +0200
commit8c83852704ad8d78b839bd532d73b3b9e44724b9 (patch)
tree6e750b39b0b6af35c9a0b3b1385a7925936bcecd /src/managers/KeybindManager.cpp
parent60c01dab01e3b58abf12c49f4a2fb224900ae401 (diff)
internal: Remove all `.c_str()` calls when using `std::vformat` (#3198)
Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com>
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index d9371718..c7beda7c 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -428,10 +428,10 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string&
// Should never happen, as we check in the ConfigManager, but oh well
if (DISPATCHER == m_mDispatchers.end()) {
- Debug::log(ERR, "Invalid handler in a keybind! (handler {} does not exist)", k.handler.c_str());
+ Debug::log(ERR, "Invalid handler in a keybind! (handler {} does not exist)", k.handler);
} else {
// call the dispatcher
- Debug::log(LOG, "Keybind triggered, calling dispatcher ({}, {}, {})", modmask, key.c_str(), keysym);
+ Debug::log(LOG, "Keybind triggered, calling dispatcher ({}, {}, {})", modmask, key, keysym);
m_iPassPressed = (int)pressed;
@@ -603,7 +603,7 @@ void CKeybindManager::spawn(std::string args) {
}
uint64_t CKeybindManager::spawnRaw(std::string args) {
- Debug::log(LOG, "Executing {}", args.c_str());
+ Debug::log(LOG, "Executing {}", args);
int socket[2];
if (pipe(socket) != 0) {
@@ -1415,7 +1415,7 @@ void CKeybindManager::workspaceOpt(std::string args) {
}
}
} else {
- Debug::log(ERR, "Invalid arg in workspaceOpt, opt \"{}\" doesn't exist.", args.c_str());
+ Debug::log(ERR, "Invalid arg in workspaceOpt, opt \"{}\" doesn't exist.", args);
return;
}
@@ -1433,9 +1433,7 @@ void CKeybindManager::renameWorkspace(std::string args) {
} else {
g_pCompositor->renameWorkspace(std::stoi(args), "");
}
- } catch (std::exception& e) {
- Debug::log(ERR, "Invalid arg in renameWorkspace, expected numeric id only or a numeric id and string name. \"{}\": \"{}\"", args.c_str(), e.what());
- }
+ } catch (std::exception& e) { Debug::log(ERR, "Invalid arg in renameWorkspace, expected numeric id only or a numeric id and string name. \"{}\": \"{}\"", args, e.what()); }
}
void CKeybindManager::exitHyprland(std::string argz) {
@@ -1661,7 +1659,7 @@ void CKeybindManager::focusWindow(std::string regexp) {
if (!PWINDOW)
return;
- Debug::log(LOG, "Focusing to window name: {}", PWINDOW->m_szTitle.c_str());
+ Debug::log(LOG, "Focusing to window name: {}", PWINDOW->m_szTitle);
if (g_pCompositor->m_pLastMonitor->activeWorkspace != PWINDOW->m_iWorkspaceID) {
Debug::log(LOG, "Fake executing workspace to move focus");
@@ -1692,14 +1690,14 @@ void CKeybindManager::setSubmap(std::string submap) {
for (auto& k : g_pKeybindManager->m_lKeybinds) {
if (k.submap == submap) {
m_szCurrentSelectedSubmap = submap;
- Debug::log(LOG, "Changed keybind submap to {}", submap.c_str());
+ Debug::log(LOG, "Changed keybind submap to {}", submap);
g_pEventManager->postEvent(SHyprIPCEvent{"submap", submap});
EMIT_HOOK_EVENT("submap", m_szCurrentSelectedSubmap);
return;
}
}
- Debug::log(ERR, "Cannot set submap {}, submap doesn't exist (wasn't registered!)", submap.c_str());
+ Debug::log(ERR, "Cannot set submap {}, submap doesn't exist (wasn't registered!)", submap);
}
void CKeybindManager::pass(std::string regexp) {
@@ -1816,7 +1814,7 @@ void CKeybindManager::dpms(std::string arg) {
m->dpmsStatus = enable;
if (!wlr_output_commit(m->output)) {
- Debug::log(ERR, "Couldn't commit output {}", m->szName.c_str());
+ Debug::log(ERR, "Couldn't commit output {}", m->szName);
}
if (enable)