From 558ec097a2e21db19a1f2edcc43f54d09c8e8ddd Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 22 Aug 2016 21:38:57 -0400 Subject: [PATCH] fix applying settings to only take actual updates into account (#1027) --- src/settings_pack.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index d45a6aaa7..c67ea6d68 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -598,6 +598,9 @@ namespace libtorrent if (index < 0 || index >= settings_pack::num_string_settings) continue; + // if the vaue did not change, don't call the update callback + if (sett.get_str(i->first) == i->second) continue; + sett.set_str(i->first, i->second); str_setting_entry_t const& sa = str_settings[i->first & settings_pack::index_mask]; if (sa.fun && ses @@ -617,6 +620,9 @@ namespace libtorrent if (index < 0 || index >= settings_pack::num_int_settings) continue; + // if the vaue did not change, don't call the update callback + if (sett.get_int(i->first) == i->second) continue; + sett.set_int(i->first, i->second); int_setting_entry_t const& sa = int_settings[i->first & settings_pack::index_mask]; if (sa.fun && ses @@ -636,6 +642,9 @@ namespace libtorrent if (index < 0 || index >= settings_pack::num_bool_settings) continue; + // if the vaue did not change, don't call the update callback + if (sett.get_bool(i->first) == i->second) continue; + sett.set_bool(i->first, i->second); bool_setting_entry_t const& sa = bool_settings[i->first & settings_pack::index_mask]; if (sa.fun && ses