mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-26 01:26:42 -05:00
check autotype syntax, high repetion, reformat code
TODO: specify what should happen when autotypesyntax incorrect
This commit is contained in:
parent
45cb97ec85
commit
4fcedc2187
2 changed files with 66 additions and 49 deletions
|
|
@ -764,6 +764,20 @@ void EditEntryWidget::updateEntryData(Entry* entry) const
|
|||
entry->setDefaultAutoTypeSequence(QString());
|
||||
}
|
||||
else {
|
||||
QRegExp autoTypeSyntax("(\\{[A-Z]*(\\s[0-9]*){0,1}\\})*");
|
||||
autoTypeSyntax.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
autoTypeSyntax.setPatternSyntax(QRegExp::RegExp);
|
||||
|
||||
|
||||
QRegExp highRepetition(".*[0-9]{3,}.*"); //the 3 means 3 digitnumbers are too much
|
||||
highRepetition.setPatternSyntax(QRegExp::RegExp);
|
||||
|
||||
if (!autoTypeSyntax.exactMatch(m_autoTypeUi->sequenceEdit->text())) {
|
||||
//@TODO handle wrong syntax
|
||||
}
|
||||
if (!highRepetition.exactMatch(m_autoTypeUi->sequenceEdit->text())) {
|
||||
//@TODO handle too much repetition
|
||||
}
|
||||
entry->setDefaultAutoTypeSequence(m_autoTypeUi->sequenceEdit->text());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue