From 3568f283442d9f4f18141f532ddef156e045f370 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 5 Jun 2018 08:40:32 +0200 Subject: opentrack: fix some Clazy warnings --- variant/default/main-window.cpp | 20 ++++++++++---------- variant/default/main-window.hpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp index 7b5ea101..24a6feb3 100644 --- a/variant/default/main-window.cpp +++ b/variant/default/main-window.cpp @@ -327,17 +327,17 @@ void main_window::register_shortcuts() t_keys keys { - t_key(s.key_start_tracking1, [&](bool) { start_tracker(); }, true), - t_key(s.key_start_tracking2, [&](bool) { start_tracker(); }, true), + 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, [&](bool) { stop_tracker(); }, true), - t_key(s.key_stop_tracking2, [&](bool) { stop_tracker(); }, true), + t_key(s.key_stop_tracking1, [this](bool) { stop_tracker(); }, true), + t_key(s.key_stop_tracking2, [this](bool) { stop_tracker(); }, true), - t_key(s.key_toggle_tracking1, [&](bool) { toggle_tracker(); }, true), - t_key(s.key_toggle_tracking2, [&](bool) { toggle_tracker(); }, true), + t_key(s.key_toggle_tracking1, [this](bool) { toggle_tracker(); }, true), + t_key(s.key_toggle_tracking2, [this](bool) { toggle_tracker(); }, true), - t_key(s.key_restart_tracking1, [&](bool) { restart_tracker(); }, true), - t_key(s.key_restart_tracking2, [&](bool) { restart_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); @@ -354,7 +354,7 @@ void main_window::die_on_config_not_writable() QMessageBox::critical(this, tr("The Octopus is sad"), - tr("Check permissions for your .ini directory:\n\n\"%1\"%2\n\nExiting now.").arg(group::ini_directory()).arg(pad), + tr("Check permissions for your .ini directory:\n\n\"%1\"%2\n\nExiting now.").arg(group::ini_directory(), pad), QMessageBox::Close, QMessageBox::NoButton); exit(EX_OSFILE); @@ -725,7 +725,7 @@ inline bool main_window::mk_window(std::unique_ptr& place, Args&&... params) } template -bool main_window::mk_dialog(std::shared_ptr lib, std::unique_ptr& d) +bool main_window::mk_dialog(const std::shared_ptr& lib, std::unique_ptr& d) { const bool just_created = mk_window_common(d, [&]() -> t* { if (lib && lib->Dialog) diff --git a/variant/default/main-window.hpp b/variant/default/main-window.hpp index bc38c517..0e3d8257 100644 --- a/variant/default/main-window.hpp +++ b/variant/default/main-window.hpp @@ -102,7 +102,7 @@ class main_window : public QMainWindow, private State // only use in impl file since no definition in header! template - bool mk_dialog(std::shared_ptr lib, std::unique_ptr& d); + bool mk_dialog(const std::shared_ptr& lib, std::unique_ptr& d); // idem template -- cgit v1.2.3