mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-07 06:27:39 +03:00
fix effective autotype sequence
This commit is contained in:
parent
92e42b581f
commit
065a85e05c
4 changed files with 103 additions and 20 deletions
|
@ -218,31 +218,29 @@ QString Entry::defaultAutoTypeSequence() const
|
|||
return m_data.defaultAutoTypeSequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the effective sequence that will be injected
|
||||
* This function return an empty string if a parent group has autotype disabled or if the entry has no parent
|
||||
*/
|
||||
QString Entry::effectiveAutoTypeSequence() const
|
||||
{
|
||||
if (autoTypeEnabled() == false) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
const Group* parent = group();
|
||||
if (!parent) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString sequence = parent->effectiveAutoTypeSequence();
|
||||
if (sequence.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
if (!m_data.defaultAutoTypeSequence.isEmpty()) {
|
||||
return m_data.defaultAutoTypeSequence;
|
||||
}
|
||||
QString sequence;
|
||||
|
||||
const Group* grp = group();
|
||||
if(grp) {
|
||||
sequence = grp->effectiveAutoTypeSequence();
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
|
||||
if (sequence.isEmpty() && (!username().isEmpty() || !password().isEmpty())) {
|
||||
if (username().isEmpty()) {
|
||||
sequence = "{PASSWORD}{ENTER}";
|
||||
}
|
||||
else if (password().isEmpty()) {
|
||||
sequence = "{USERNAME}{ENTER}";
|
||||
}
|
||||
else {
|
||||
sequence = "{USERNAME}{TAB}{PASSWORD}{ENTER}";
|
||||
}
|
||||
}
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue