fix: compare settings before updating them (#5240)

This commit is contained in:
pajlada
2024-03-09 16:03:26 +01:00
committed by GitHub
parent 2e77b47ea1
commit 2361d30e4b
5 changed files with 17 additions and 4 deletions
+1
View File
@@ -75,6 +75,7 @@
- Bugfix: Fixed triple click on message also selecting moderation buttons. (#4961)
- Bugfix: Fixed a freeze from a bad regex in _Ignores_. (#4965, #5126)
- Bugfix: Fixed badge highlight changes not immediately being reflected. (#5110)
- Bugfix: Fixed emotes being reloaded when pressing "Cancel" in the settings dialog, causing a slowdown. (#5240)
- Bugfix: Fixed some emotes not appearing when using _Ignores_. (#4965, #5126)
- Bugfix: Fixed lookahead/-behind not working in _Ignores_. (#4965, #5126)
- Bugfix: Fixed Image Uploader accidentally deleting images with some hosts when link resolver was enabled. (#4971)
+5 -2
View File
@@ -13,13 +13,16 @@ class ChatterinoSetting : public pajlada::Settings::Setting<Type>
{
public:
ChatterinoSetting(const std::string &path)
: pajlada::Settings::Setting<Type>(path)
: pajlada::Settings::Setting<Type>(
path, pajlada::Settings::SettingOption::CompareBeforeSet)
{
_registerSetting(this->getData());
}
ChatterinoSetting(const std::string &path, const Type &defaultValue)
: pajlada::Settings::Setting<Type>(path, defaultValue)
: pajlada::Settings::Setting<Type>(
path, defaultValue,
pajlada::Settings::SettingOption::CompareBeforeSet)
{
_registerSetting(this->getData());
}
+5
View File
@@ -7,6 +7,11 @@ ChannelLog::ChannelLog(QString channelName)
{
}
bool ChannelLog::operator==(const ChannelLog &other) const
{
return this->channelName_ == other.channelName_;
}
QString ChannelLog::channelName() const
{
return this->channelName_.toLower();
+5 -1
View File
@@ -9,6 +9,7 @@
#include "controllers/moderationactions/ModerationAction.hpp"
#include "controllers/nicknames/Nickname.hpp"
#include "debug/Benchmark.hpp"
#include "pajlada/settings/signalargs.hpp"
#include "util/Clamp.hpp"
#include "util/PersistSignalVector.hpp"
#include "util/WindowsHelper.hpp"
@@ -257,7 +258,10 @@ void Settings::restoreSnapshot()
continue;
}
setting->marshalJSON(snapshot[path]);
pajlada::Settings::SignalArgs args;
args.compareBeforeSet = true;
setting->marshalJSON(snapshot[path], std::move(args));
}
}