summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-12-14 21:34:37 +0100
committerStanislaw Halik <sthalik@misaki.pl>2021-12-14 21:43:03 +0100
commit0ebf65f45145a678acbd93c30990c288b582bbd9 (patch)
tree495e45d103fbe1bc3bded07dd74f559ceaa0cae0
parentbc98d7c1218d6e7758d9c68592e1c8560570d8ad (diff)
logic, opentrack: remove redundant casts
-rw-r--r--logic/work.hpp20
-rw-r--r--opentrack/main-window.cpp6
2 files changed, 13 insertions, 13 deletions
diff --git a/logic/work.hpp b/logic/work.hpp
index 82449e47..6521c09d 100644
--- a/logic/work.hpp
+++ b/logic/work.hpp
@@ -45,18 +45,18 @@ public:
std::vector<key_tuple> keys {
// third argument means "keydown only"
- key_tuple(s.key_center1, [&](bool x) { pipeline_.set_held_center(x); }, false),
- key_tuple(s.key_center2, [&](bool x) { pipeline_.set_held_center(x); }, false),
+ key_tuple(s.key_center1, [this](bool x) { pipeline_.set_held_center(x); }, false),
+ key_tuple(s.key_center2, [this](bool x) { pipeline_.set_held_center(x); }, false),
- key_tuple(s.key_toggle1, [&](bool) { pipeline_.toggle_enabled(); }, true),
- key_tuple(s.key_toggle2, [&](bool) { pipeline_.toggle_enabled(); }, true),
- key_tuple(s.key_toggle_press1, [&](bool x) { pipeline_.set_enabled(!x); }, false),
- key_tuple(s.key_toggle_press2, [&](bool x) { pipeline_.set_enabled(!x); }, false),
+ key_tuple(s.key_toggle1, [this](bool) { pipeline_.toggle_enabled(); }, true),
+ key_tuple(s.key_toggle2, [this](bool) { pipeline_.toggle_enabled(); }, true),
+ key_tuple(s.key_toggle_press1, [this](bool x) { pipeline_.set_enabled(!x); }, false),
+ key_tuple(s.key_toggle_press2, [this](bool x) { pipeline_.set_enabled(!x); }, false),
- key_tuple(s.key_zero1, [&](bool) { pipeline_.toggle_zero(); }, true),
- key_tuple(s.key_zero2, [&](bool) { pipeline_.toggle_zero(); }, true),
- key_tuple(s.key_zero_press1, [&](bool x) { pipeline_.set_zero(x); }, false),
- key_tuple(s.key_zero_press2, [&](bool x) { pipeline_.set_zero(x); }, false),
+ key_tuple(s.key_zero1, [this](bool) { pipeline_.toggle_zero(); }, true),
+ key_tuple(s.key_zero2, [this](bool) { pipeline_.toggle_zero(); }, true),
+ key_tuple(s.key_zero_press1, [this](bool x) { pipeline_.set_zero(x); }, false),
+ key_tuple(s.key_zero_press2, [this](bool x) { pipeline_.set_zero(x); }, false),
};
Work(const Mappings& m, event_handler& ev, QFrame* frame,
diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp
index 85c34c51..314e82f2 100644
--- a/opentrack/main-window.cpp
+++ b/opentrack/main-window.cpp
@@ -87,10 +87,10 @@ void main_window::init_dylibs()
this, [&](const QString&) { pTrackerDialog = nullptr; });
connect(ui.iconcomboProtocol, &QComboBox::currentTextChanged,
- this, [&](const QString&) { pProtocolDialog = nullptr; });
+ this, [this](const QString&) { pProtocolDialog = nullptr; });
connect(ui.iconcomboFilter, &QComboBox::currentTextChanged,
- this, [&](const QString&) { pFilterDialog = nullptr; });
+ this, [this](const QString&) { pFilterDialog = nullptr; });
connect(&m.tracker_dll, value_::value_changed<QString>(),
this, &main_window::save_modules,
@@ -176,7 +176,7 @@ void main_window::init_tray_menu()
menu_action_show.setIconVisibleInMenu(true);
menu_action_show.setText(isHidden() ? tr("Show the Octopus") : tr("Hide the Octopus"));
menu_action_show.setIcon(QIcon(":/images/opentrack.png"));
- QObject::connect(&menu_action_show, &QAction::triggered, this, [&] { toggle_restore_from_tray(QSystemTrayIcon::Trigger); });
+ QObject::connect(&menu_action_show, &QAction::triggered, this, [this] { toggle_restore_from_tray(QSystemTrayIcon::Trigger); });
tray_menu.addAction(&menu_action_show);
tray_menu.addSeparator();