Fix aliases being duplicated in the aliases list in some cases

This commit is contained in:
Nicolas Werner 2022-07-11 14:23:12 +02:00
parent ac0de5779e
commit d5b06939fd
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -37,8 +37,8 @@ AliasEditingModel::AliasEditingModel(const std::string &rid, QObject *parent)
for (const auto &alias : aliasEvent.alt_aliases) {
if (!seen_aliases.count(alias)) {
aliases.push_back(Entry{aliasEvent.alias, false, true, false});
seen_aliases.insert(aliasEvent.alias);
aliases.push_back(Entry{alias, false, true, false});
seen_aliases.insert(alias);
}
}
@ -308,6 +308,7 @@ AliasEditingModel::updatePublishedAliases(std::vector<std::string> advAliases)
found = true;
break;
}
}
if (!found) {
beginInsertRows(QModelIndex(), aliases.size(), aliases.size());
@ -315,7 +316,6 @@ AliasEditingModel::updatePublishedAliases(std::vector<std::string> advAliases)
endInsertRows();
}
}
}
}
void