From b50e107d8971f47e9d3aa90f44551de44328142b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 2 Jul 2018 08:27:59 +0200 Subject: opentrack/main-window: use more aggregate initialization This is new in C++17, cf. P0017R1. --- variant/default/main-window.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'variant/default') diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp index 8e5cd10c..b653f139 100644 --- a/variant/default/main-window.cpp +++ b/variant/default/main-window.cpp @@ -322,25 +322,19 @@ void main_window::init_tray() void main_window::register_shortcuts() { - using t_key = Shortcuts::t_key; - using t_keys = Shortcuts::t_keys; + global_shortcuts.reload({ + { s.key_start_tracking1, [this](bool) { start_tracker(); }, true }, + { s.key_start_tracking2, [this](bool) { start_tracker(); }, true }, - t_keys keys - { - t_key(s.key_start_tracking1, [this](bool) { start_tracker(); }, true), - t_key(s.key_start_tracking2, [this](bool) { start_tracker(); }, true), - - t_key(s.key_stop_tracking1, [this](bool) { stop_tracker(); }, true), - t_key(s.key_stop_tracking2, [this](bool) { stop_tracker(); }, true), + { s.key_stop_tracking1, [this](bool) { stop_tracker(); }, true }, + { s.key_stop_tracking2, [this](bool) { stop_tracker(); }, true }, - t_key(s.key_toggle_tracking1, [this](bool) { toggle_tracker(); }, true), - t_key(s.key_toggle_tracking2, [this](bool) { toggle_tracker(); }, true), + { s.key_toggle_tracking1, [this](bool) { toggle_tracker(); }, true }, + { s.key_toggle_tracking2, [this](bool) { toggle_tracker(); }, true }, - t_key(s.key_restart_tracking1, [this](bool) { restart_tracker(); }, true), - t_key(s.key_restart_tracking2, [this](bool) { restart_tracker(); }, true), - }; - - global_shortcuts.reload(keys); + { s.key_restart_tracking1, [this](bool) { restart_tracker(); }, true }, + { s.key_restart_tracking2, [this](bool) { restart_tracker(); }, true }, + }); if (work) work->reload_shortcuts(); -- cgit v1.2.3