mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-28 10:21:09 -05:00
Merge pull request #268 from keepassxreboot/fix/custom-attribute
Fix autotype custom-attribute placeholder
This commit is contained in:
commit
ac4346719b
@ -646,12 +646,17 @@ QString Entry::resolvePlaceholder(const QString& str) const
|
|||||||
const QList<QString> keyList = attributes()->keys();
|
const QList<QString> keyList = attributes()->keys();
|
||||||
for (const QString& key : keyList) {
|
for (const QString& key : keyList) {
|
||||||
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
||||||
|
QString k = key;
|
||||||
|
|
||||||
if (!EntryAttributes::isDefaultAttribute(key)) {
|
if (!EntryAttributes::isDefaultAttribute(key)) {
|
||||||
cs = Qt::CaseSensitive;
|
cs = Qt::CaseSensitive;
|
||||||
|
k.prepend("{S:");
|
||||||
|
} else {
|
||||||
|
k.prepend("{");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString k = key;
|
|
||||||
k.prepend("{").append("}");
|
k.append("}");
|
||||||
if (result.compare(k,cs)==0) {
|
if (result.compare(k,cs)==0) {
|
||||||
result.replace(result,attributes()->value(key));
|
result.replace(result,attributes()->value(key));
|
||||||
break;
|
break;
|
||||||
|
@ -96,10 +96,10 @@ void TestAutoType::init()
|
|||||||
m_entry4->setPassword("custom_attr");
|
m_entry4->setPassword("custom_attr");
|
||||||
m_entry4->attributes()->set("CUSTOM","Attribute",false);
|
m_entry4->attributes()->set("CUSTOM","Attribute",false);
|
||||||
association.window = "//^CustomAttr1$//";
|
association.window = "//^CustomAttr1$//";
|
||||||
association.sequence = "{PASSWORD}:{CUSTOM}";
|
association.sequence = "{PASSWORD}:{S:CUSTOM}";
|
||||||
m_entry4->autoTypeAssociations()->add(association);
|
m_entry4->autoTypeAssociations()->add(association);
|
||||||
association.window = "//^CustomAttr2$//";
|
association.window = "//^CustomAttr2$//";
|
||||||
association.sequence = "{CuStOm}";
|
association.sequence = "{S:CuStOm}";
|
||||||
m_entry4->autoTypeAssociations()->add(association);
|
m_entry4->autoTypeAssociations()->add(association);
|
||||||
association.window = "//^CustomAttr3$//";
|
association.window = "//^CustomAttr3$//";
|
||||||
association.sequence = "{PaSSworD}";
|
association.sequence = "{PaSSworD}";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user