fix duplicate autotype sequences

This commit is contained in:
thez3ro 2018-01-31 21:53:53 +01:00
parent b4cf98998e
commit 16fad1aba1
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073

View File

@ -285,10 +285,10 @@ void AutoType::performGlobalAutoType(const QList<Database*>& dbList)
for (Database* db : dbList) {
const QList<Entry*> dbEntries = db->rootGroup()->entriesRecursive();
for (Entry* entry : dbEntries) {
const QList<QString> sequences = autoTypeSequences(entry, windowTitle);
const QSet<QString> sequences = autoTypeSequences(entry, windowTitle).toSet();
for (const QString& sequence : sequences) {
if (!sequence.isEmpty()) {
matchList << AutoTypeMatch(entry,sequence);
matchList << AutoTypeMatch(entry, sequence);
}
}
}
@ -531,6 +531,7 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
/**
* Retrive the autotype sequences matches for a given windowTitle
* This returns a list with priority ordering. If you don't want duplicates call .toSet() on it.
*/
QList<QString> AutoType::autoTypeSequences(const Entry* entry, const QString& windowTitle)
{