diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-11 14:23:12 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-11 14:23:12 +0200 |
commit | d5b06939fdcfad7abc5ce9aec80d3921619b1a1a (patch) | |
tree | c9ba7e132af8f978bd076d8e510432ca138b467e /src/AliasEditModel.cpp | |
parent | ac0de5779e61cc556c551daea49a2ef496f74064 (diff) |
Fix aliases being duplicated in the aliases list in some cases
Diffstat (limited to 'src/AliasEditModel.cpp')
-rw-r--r-- | src/AliasEditModel.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/AliasEditModel.cpp b/src/AliasEditModel.cpp index 01e3df5d..aee42dd1 100644 --- a/src/AliasEditModel.cpp +++ b/src/AliasEditModel.cpp @@ -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,12 +308,12 @@ AliasEditingModel::updatePublishedAliases(std::vector<std::string> advAliases) found = true; break; } + } - if (!found) { - beginInsertRows(QModelIndex(), aliases.size(), aliases.size()); - aliases.push_back(Entry{advAlias, false, false, true}); - endInsertRows(); - } + if (!found) { + beginInsertRows(QModelIndex(), aliases.size(), aliases.size()); + aliases.push_back(Entry{advAlias, false, false, true}); + endInsertRows(); } } } |