summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-01-25 23:47:18 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-01-25 23:55:03 +0100
commit68000e9f3df1ec218680bdfd565b9e0fbd90ff55 (patch)
tree6cdd672be12f42a2b7b8e4046babc0720b36556e /logic
parent16f282e34af70dffd0d6f480291d3a939fadfb7b (diff)
logic/shortcuts: use structured bindings
Diffstat (limited to 'logic')
-rw-r--r--logic/shortcuts.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/logic/shortcuts.cpp b/logic/shortcuts.cpp
index 26465101..850425c6 100644
--- a/logic/shortcuts.cpp
+++ b/logic/shortcuts.cpp
@@ -70,7 +70,7 @@ void Shortcuts::bind_shortcut(K& key, const key_opts& k, bool held)
code != QKeySequence{ QKeySequence::UnknownKey } &&
win_key::from_qt(code, idx, mods))
{
- key.guid = "";
+ key.guid = QString{};
key.keycode = idx;
key.held = held;
key.ctrl = !!(mods & Qt::ControlModifier);
@@ -88,7 +88,7 @@ void Shortcuts::receiver(const Key& key)
const unsigned sz = keys.size();
for (unsigned i = 0; i < sz; i++)
{
- K& k = std::get<0>(keys[i]);
+ auto& [k, f, held] = keys[i];
if (key.guid != k.guid)
continue;
if (key.keycode != k.keycode)
@@ -103,7 +103,6 @@ void Shortcuts::receiver(const Key& key)
if (!k.should_process())
continue;
}
- fun& f = std::get<1>(keys[i]);
f(key.held);
}
}