mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-02 14:46:07 -04:00
Add initial support for encrypted database fields.
This commit is contained in:
parent
ce834cda46
commit
cfb55828b6
9 changed files with 153 additions and 21 deletions
|
@ -114,6 +114,16 @@ const QHash<QString, QByteArray>& Entry::attachments() const
|
|||
return m_binaries;
|
||||
}
|
||||
|
||||
bool Entry::isAttributeProtected(const QString& key) const
|
||||
{
|
||||
return m_protectedAttributes.contains(key);
|
||||
}
|
||||
|
||||
bool Entry::isAttachmentProtected(const QString& key) const
|
||||
{
|
||||
return m_protectedAttachments.contains(key);
|
||||
}
|
||||
|
||||
QString Entry::title() const
|
||||
{
|
||||
return m_attributes.value("Title");
|
||||
|
@ -207,9 +217,12 @@ void Entry::addAutoTypeAssociation(const AutoTypeAssociation& assoc)
|
|||
m_autoTypeAssociations << assoc;
|
||||
}
|
||||
|
||||
void Entry::addAttribute(const QString& key, const QString& value)
|
||||
void Entry::addAttribute(const QString& key, const QString& value, bool protect)
|
||||
{
|
||||
m_attributes.insert(key, value);
|
||||
if (protect) {
|
||||
m_protectedAttributes.insert(key);
|
||||
}
|
||||
|
||||
// TODO add all visible oclumns
|
||||
if (key == "Title") {
|
||||
|
@ -217,9 +230,24 @@ void Entry::addAttribute(const QString& key, const QString& value)
|
|||
}
|
||||
}
|
||||
|
||||
void Entry::addAttachment(const QString& key, const QByteArray& value)
|
||||
void Entry::removeAttribute(const QString& key)
|
||||
{
|
||||
m_attributes.remove(key);
|
||||
m_protectedAttributes.remove(key);
|
||||
}
|
||||
|
||||
void Entry::addAttachment(const QString& key, const QByteArray& value, bool protect)
|
||||
{
|
||||
m_binaries.insert(key, value);
|
||||
if (protect) {
|
||||
m_protectedAttachments.insert(key);
|
||||
}
|
||||
}
|
||||
|
||||
void Entry::removeAttachment(const QString& key)
|
||||
{
|
||||
m_binaries.remove(key);
|
||||
m_protectedAttachments.remove(key);
|
||||
}
|
||||
|
||||
void Entry::setTitle(const QString& title)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue