diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-01 18:07:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-01 18:07:03 +0200 |
commit | a67e8630caf20e7f48151024e9e68dd9271d75c7 (patch) | |
tree | e7418eabdfb4abd6ca88c0ba6a427ca5a40e7c32 /opentrack | |
parent | 74dff816c07737b7e697e5d63222e59a9fefe23e (diff) |
options/value: add `QObject::connect` wrapper
This is useful not just to save on complexity in call sites, but also
because I plan on using the Verdigris library to remove needless
`valueChanged()` and `setValue()` overloads from each `value<t>`
instance.
Also fix a bug in `options/tie.hpp` where `QComboBox::setCurrentIndex`
was erroneously called as `Qt::DirectConnection`.
Diffstat (limited to 'opentrack')
-rw-r--r-- | opentrack/main-window.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index b879e773..fadcf1e5 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -112,17 +112,9 @@ void main_window::init_dylibs() this, [this](const QString&) { pFilterDialog = nullptr; if (options_widget) options_widget->filter_module_changed(); }); #endif - connect(&m.tracker_dll, value_::value_changed<QString>(), - this, &main_window::save_modules, - Qt::DirectConnection); - - connect(&m.protocol_dll, value_::value_changed<QString>(), - this, &main_window::save_modules, - Qt::DirectConnection); - - connect(&m.filter_dll, value_::value_changed<QString>(), - this, &main_window::save_modules, - Qt::DirectConnection); + m.tracker_dll.connect_to(this, &main_window::save_modules, Qt::DirectConnection); + m.protocol_dll.connect_to(this, &main_window::save_modules, Qt::DirectConnection); + m.filter_dll.connect_to(this, &main_window::save_modules, Qt::DirectConnection); { struct list { @@ -239,8 +231,7 @@ void main_window::init_tray_menu() QObject::connect(&menu_action_exit, &QAction::triggered, this, &main_window::exit); tray_menu.addAction(&menu_action_exit); - connect(&s.tray_enabled, value_::value_changed<bool>(), - this, &main_window::ensure_tray); + s.tray_enabled.connect_to(this, &main_window::ensure_tray, Qt::DirectConnection); } void main_window::init_buttons() |