summaryrefslogtreecommitdiffhomepage
path: root/logic/shortcuts.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-24 18:09:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-27 16:42:59 +0200
commitfcafbe06947bf24f9c9ac2811dcbd123a672a380 (patch)
treeeec1b46e6ab4c261a59300001b51a8fbdf115a17 /logic/shortcuts.h
parent17c2d20f7e9036351abf9f86bc09636e0b8a0559 (diff)
logic: use c++14-style in-line initializers
Diffstat (limited to 'logic/shortcuts.h')
-rw-r--r--logic/shortcuts.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/logic/shortcuts.h b/logic/shortcuts.h
index 5f23d2e7..2e630782 100644
--- a/logic/shortcuts.h
+++ b/logic/shortcuts.h
@@ -27,10 +27,14 @@
using namespace options;
-struct OTR_LOGIC_EXPORT Shortcuts final : public QObject
+class OTR_LOGIC_EXPORT Shortcuts final : public QObject
{
Q_OBJECT
+#ifdef _WIN32
+ void receiver(const Key& k);
+#endif
+
public:
using K =
#ifndef _WIN32
@@ -46,21 +50,14 @@ public:
using t_keys = std::vector<t_key>;
std::vector<tt> keys;
#ifdef _WIN32
- KeybindingWorker::Token key_token;
+ KeybindingWorker::Token key_token = [this](const Key& k) { receiver(k); };
#endif
- Shortcuts()
-#ifdef _WIN32
- : key_token([&](const Key& k) { receiver(k); })
-#endif
- {}
+ Shortcuts() {}
~Shortcuts();
void reload(const t_keys& keys_);
private:
void free_binding(K& key);
void bind_shortcut(K &key, const key_opts& k, bool held);
-#ifdef _WIN32
- void receiver(const Key& k);
-#endif
};