mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 00:10:37 -05:00
refactor autotype sequences and entry-point functions
This commit is contained in:
parent
b5cabbeb43
commit
a9479fd662
8 changed files with 99 additions and 57 deletions
|
|
@ -29,6 +29,8 @@
|
|||
|
||||
const int Entry::DefaultIconNumber = 0;
|
||||
const int Entry::ResolveMaximumDepth = 10;
|
||||
const QString Entry::AutoTypeSequenceUsername = "{USERNAME}{ENTER}";
|
||||
const QString Entry::AutoTypeSequencePassword = "{PASSWORD}{ENTER}";
|
||||
|
||||
|
||||
Entry::Entry()
|
||||
|
|
@ -232,7 +234,7 @@ QString Entry::effectiveAutoTypeSequence() const
|
|||
if (!parent) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
QString sequence = parent->effectiveAutoTypeSequence();
|
||||
if (sequence.isEmpty()) {
|
||||
return QString();
|
||||
|
|
@ -242,6 +244,15 @@ QString Entry::effectiveAutoTypeSequence() const
|
|||
return m_data.defaultAutoTypeSequence;
|
||||
}
|
||||
|
||||
if (sequence == Group::RootAutoTypeSequence && (!username().isEmpty() || !password().isEmpty())) {
|
||||
if (username().isEmpty()) {
|
||||
return AutoTypeSequencePassword;
|
||||
} else if (password().isEmpty()) {
|
||||
return AutoTypeSequenceUsername;
|
||||
}
|
||||
return Group::RootAutoTypeSequence;
|
||||
}
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue