mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Mask passwords in URL column in Entry View
This commit is contained in:
parent
cb0b948603
commit
59786d7bd7
@ -727,6 +727,13 @@ const Database* Entry::database() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Entry::maskPasswordPlaceholders(const QString &str) const
|
||||||
|
{
|
||||||
|
QString result = str;
|
||||||
|
result.replace(QRegExp("(\\{PASSWORD\\})", Qt::CaseInsensitive, QRegExp::RegExp2), "******");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
QString Entry::resolveMultiplePlaceholders(const QString& str) const
|
QString Entry::resolveMultiplePlaceholders(const QString& str) const
|
||||||
{
|
{
|
||||||
QString result = str;
|
QString result = str;
|
||||||
|
@ -142,6 +142,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
Entry* clone(CloneFlags flags) const;
|
Entry* clone(CloneFlags flags) const;
|
||||||
void copyDataFrom(const Entry* other);
|
void copyDataFrom(const Entry* other);
|
||||||
|
QString maskPasswordPlaceholders(const QString& str) const;
|
||||||
QString resolveMultiplePlaceholders(const QString& str) const;
|
QString resolveMultiplePlaceholders(const QString& str) const;
|
||||||
QString resolvePlaceholder(const QString& str) const;
|
QString resolvePlaceholder(const QString& str) const;
|
||||||
QString resolveUrl(const QString& url) const;
|
QString resolveUrl(const QString& url) const;
|
||||||
|
@ -151,7 +151,8 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
case Url:
|
case Url:
|
||||||
result = entry->resolveMultiplePlaceholders(entry->url());
|
result = entry->maskPasswordPlaceholders(entry->url());
|
||||||
|
result = entry->resolveMultiplePlaceholders(result);
|
||||||
if (attr->isReference(EntryAttributes::URLKey)) {
|
if (attr->isReference(EntryAttributes::URLKey)) {
|
||||||
result.prepend(tr("Ref: ","Reference abbreviation"));
|
result.prepend(tr("Ref: ","Reference abbreviation"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user