mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed regex plugins not getting saved.
Or equality-compared.
This commit is contained in:
+15
-2
@@ -126,7 +126,7 @@ namespace loot {
|
||||
YAML::Emitter yout;
|
||||
yout.SetIndent(2);
|
||||
yout << YAML::BeginMap
|
||||
<< YAML::Key << "plugins" << YAML::Value << plugins
|
||||
<< YAML::Key << "plugins" << YAML::Value << Plugins()
|
||||
<< YAML::Key << "globals" << YAML::Value << messages
|
||||
<< YAML::EndMap;
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace loot {
|
||||
}
|
||||
|
||||
bool MetadataList::operator == (const MetadataList& rhs) const {
|
||||
if (this->plugins.size() != rhs.plugins.size() || this->messages.size() != rhs.messages.size()) {
|
||||
if (this->plugins.size() != rhs.plugins.size() || this->messages.size() != rhs.messages.size() || this->regexPlugins.size() != rhs.regexPlugins.size()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Metadata edited for some plugin, new and old userlists differ in size.";
|
||||
return false;
|
||||
}
|
||||
@@ -159,6 +159,19 @@ namespace loot {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (const auto& rhsPlugin : rhs.regexPlugins) {
|
||||
const auto it = find(regexPlugins.begin(), regexPlugins.end(), rhsPlugin);
|
||||
|
||||
if (it == this->regexPlugins.end()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Metadata added for plugin: " << it->Name();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!it->DiffMetadata(rhsPlugin).HasNameOnly()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "Metadata edited for plugin: " << it->Name();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Messages are compared exactly by the '==' operator, so there's no need to do a more
|
||||
// fine-grained check.
|
||||
for (const auto& rhsMessage : rhs.messages) {
|
||||
|
||||
Reference in New Issue
Block a user