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. --- migration/20171013_00-tracker-pt-threshold.cpp | 9 ++++----- migration/migration.hpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'migration') diff --git a/migration/20171013_00-tracker-pt-threshold.cpp b/migration/20171013_00-tracker-pt-threshold.cpp index aab64de7..c9c070fa 100644 --- a/migration/20171013_00-tracker-pt-threshold.cpp +++ b/migration/20171013_00-tracker-pt-threshold.cpp @@ -24,7 +24,6 @@ struct move_int_to_slider : migration return "20171013_00"; } - QString name() const override { return "tracker/pt threshold slider (int -> slider_value)"; @@ -32,19 +31,19 @@ struct move_int_to_slider : migration bool should_run() const override { - bundle b = make_bundle("tracker-pt"); + bundle b = make_bundle(bundle_name); return b->contains(old_name) && !b->contains(new_name); } void run() override { - bundle b = make_bundle("tracker-pt"); + bundle b = make_bundle(bundle_name); value old_val(b, old_name, 128); - value new_val(b, new_name, slider_value(128, 0, 255)); + value new_val(b, new_name, { 128, 0, 255 }); - new_val = slider_value(old_val.to(), 0, 255); + new_val = { old_val.to(), 0, 255 }; b->save(); } diff --git a/migration/migration.hpp b/migration/migration.hpp index fc370a15..48689fc6 100644 --- a/migration/migration.hpp +++ b/migration/migration.hpp @@ -50,7 +50,7 @@ namespace detail { { registrator() { - mfun f { []() { return std::shared_ptr(new t); } }; + mfun f { [] { return std::shared_ptr(new t); } }; migrator::add_migration_thunk(f); } -- cgit v1.2.3