From f50ac3549d6a7f1199fa012e4b03f581bc8d305b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 22 Jun 2018 12:54:47 +0200 Subject: core, modules: modernize syntax only Use more C++17 features where this helps any. --- options/tie.cpp | 2 +- options/tie.hpp | 8 ++++---- options/value-traits.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'options') diff --git a/options/tie.cpp b/options/tie.cpp index baa8bb82..0042a0fb 100644 --- a/options/tie.cpp +++ b/options/tie.cpp @@ -59,7 +59,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) base_value::connect(&v, base_value::value_changed(), cb, [cb, set_idx](const QVariant& var) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { set_idx(var); }); }, v.DIRECT_CONNTYPE); diff --git a/options/tie.hpp b/options/tie.hpp index ca5eae5e..ff82142e 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -40,7 +40,7 @@ std::enable_if_t> tie_setting(value& v, QComboBox* cb) base_value::connect(cb, static_cast(&QComboBox::currentIndexChanged), &v, [&v, cb](int idx) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { v = static_cast(cb->itemData(idx).toInt()); }); }, @@ -48,7 +48,7 @@ std::enable_if_t> tie_setting(value& v, QComboBox* cb) base_value::connect(&v, base_value::value_changed(), cb, [cb](int x) { - run_in_thread_sync(cb, [=]() { cb->setCurrentIndex(cb->findData(x)); }); + run_in_thread_sync(cb, [=] { cb->setCurrentIndex(cb->findData(x)); }); }, v.DIRECT_CONNTYPE); } @@ -61,13 +61,13 @@ void tie_setting(value& v, QComboBox* cb, From&& fn_to_index, To&& fn_to_valu base_value::connect(cb, static_cast(&QComboBox::currentIndexChanged), &v, [&v, cb, fn_to_value](int idx) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { v = fn_to_value(idx, cb->currentData()); }); }, v.DIRECT_CONNTYPE); base_value::connect(&v, base_value::value_changed(), cb, [&v, cb, fn_to_index](cv_qualified& v) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { cb->setCurrentIndex(fn_to_index(v)); }); }); diff --git a/options/value-traits.hpp b/options/value-traits.hpp index 8a04b46d..0b30248e 100644 --- a/options/value-traits.hpp +++ b/options/value-traits.hpp @@ -34,7 +34,7 @@ struct value_traits : default_value_traits { static inline slider_value from_value(const slider_value& val, const slider_value& def) { - return slider_value(val.cur(), def.min(), def.max()); + return { val.cur(), def.min(), def.max() }; } }; -- cgit v1.2.3