Prevent duplicate characters in "Also choose from" field of password generator (#9803)

* Fixes #9797
This commit is contained in:
f4lkensmaz3 2024-01-06 21:54:30 +00:00 committed by Jonathan White
parent 3094302bcc
commit 53d06f127d

View File

@ -261,8 +261,10 @@ QVector<PasswordGroup> PasswordGenerator::passwordGroups() const
if (!m_custom.isEmpty()) { if (!m_custom.isEmpty()) {
PasswordGroup group; PasswordGroup group;
for (auto ch : m_custom) { for (const auto& ch : m_custom) {
group.append(ch); if (!group.contains(ch)) {
group.append(ch);
}
} }
passwordGroups.append(group); passwordGroups.append(group);