From 19d2b71aa8f385fee0c4cd3aa9fdf4f2f3279749 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 2 Mar 2019 00:26:14 +0100 Subject: options: consistently use rvalue references --- options/bundle.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'options/bundle.cpp') diff --git a/options/bundle.cpp b/options/bundle.cpp index a17b04fb..20cc5d90 100644 --- a/options/bundle.cpp +++ b/options/bundle.cpp @@ -67,7 +67,7 @@ void bundle::set_all_to_default() connector::set_all_to_default_(); } -void bundle::store_kv(const QString& name, const QVariant& new_value) +void bundle::store_kv(const QString& name, QVariant&& value) { if (group_name.isEmpty()) return; @@ -75,13 +75,21 @@ void bundle::store_kv(const QString& name, const QVariant& new_value) { mark_ini_modified(); QMutexLocker l{&mtx}; - transient.put(name, new_value); + transient.put(name, value); connector::notify_values(name); } emit changed(); } +void bundle::store_kv(const QString& name, const QVariant& value) +{ + if (group_name.isEmpty()) + return; + + store_kv(name, QVariant{value}); +} + QVariant bundle::get_variant(const QString& name) const { QMutexLocker l{&mtx}; -- cgit v1.2.3