diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-24 18:09:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-27 16:42:59 +0200 |
commit | fcafbe06947bf24f9c9ac2811dcbd123a672a380 (patch) | |
tree | eec1b46e6ab4c261a59300001b51a8fbdf115a17 /logic/shortcuts.h | |
parent | 17c2d20f7e9036351abf9f86bc09636e0b8a0559 (diff) |
logic: use c++14-style in-line initializers
Diffstat (limited to 'logic/shortcuts.h')
-rw-r--r-- | logic/shortcuts.h | 17 |
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 }; |