mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-11 23:39:50 -05:00
Add convenience methods to access common attributes.
This commit is contained in:
parent
48c498890f
commit
84bc5ef463
@ -91,6 +91,31 @@ const QHash<QString, QByteArray>& Entry::attachments() const
|
|||||||
return m_binaries;
|
return m_binaries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Entry::title() const
|
||||||
|
{
|
||||||
|
return m_attributes.value("Title");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Entry::url() const
|
||||||
|
{
|
||||||
|
return m_attributes.value("URL");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Entry::username() const
|
||||||
|
{
|
||||||
|
return m_attributes.value("UserName");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Entry::password() const
|
||||||
|
{
|
||||||
|
return m_attributes.value("Password");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Entry::notes() const
|
||||||
|
{
|
||||||
|
return m_attributes.value("Notes");
|
||||||
|
}
|
||||||
|
|
||||||
void Entry::setUuid(const Uuid& uuid)
|
void Entry::setUuid(const Uuid& uuid)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!uuid.isNull());
|
Q_ASSERT(!uuid.isNull());
|
||||||
@ -164,6 +189,31 @@ void Entry::addAttachment(const QString& key, const QByteArray& value)
|
|||||||
m_binaries.insert(key, value);
|
m_binaries.insert(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Entry::setTitle(const QString& title)
|
||||||
|
{
|
||||||
|
m_attributes.insert("Title", title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Entry::setUrl(const QString& url)
|
||||||
|
{
|
||||||
|
m_attributes.insert("URL", url);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Entry::setUsername(const QString& username)
|
||||||
|
{
|
||||||
|
m_attributes.insert("UserName", username);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Entry::setPassword(const QString& password)
|
||||||
|
{
|
||||||
|
m_attributes.insert("Password", password);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Entry::setNotes(const QString& notes)
|
||||||
|
{
|
||||||
|
m_attributes.insert("Notes", notes);
|
||||||
|
}
|
||||||
|
|
||||||
void Entry::setGroup(Group* group)
|
void Entry::setGroup(Group* group)
|
||||||
{
|
{
|
||||||
if (m_group) {
|
if (m_group) {
|
||||||
|
@ -53,6 +53,11 @@ public:
|
|||||||
const QList<AutoTypeAssociation>& autoTypeAssociations() const;
|
const QList<AutoTypeAssociation>& autoTypeAssociations() const;
|
||||||
const QHash<QString, QString>& attributes() const;
|
const QHash<QString, QString>& attributes() const;
|
||||||
const QHash<QString, QByteArray>& attachments() const;
|
const QHash<QString, QByteArray>& attachments() const;
|
||||||
|
QString title() const;
|
||||||
|
QString url() const;
|
||||||
|
QString username() const;
|
||||||
|
QString password() const;
|
||||||
|
QString notes() const;
|
||||||
|
|
||||||
void setUuid(const Uuid& uuid);
|
void setUuid(const Uuid& uuid);
|
||||||
void setIcon(int iconNumber);
|
void setIcon(int iconNumber);
|
||||||
@ -67,6 +72,11 @@ public:
|
|||||||
void addAutoTypeAssociation(const AutoTypeAssociation& assoc);
|
void addAutoTypeAssociation(const AutoTypeAssociation& assoc);
|
||||||
void addAttribute(const QString& key, const QString& value);
|
void addAttribute(const QString& key, const QString& value);
|
||||||
void addAttachment(const QString& key, const QByteArray& value);
|
void addAttachment(const QString& key, const QByteArray& value);
|
||||||
|
void setTitle(const QString& title);
|
||||||
|
void setUrl(const QString& url);
|
||||||
|
void setUsername(const QString& username);
|
||||||
|
void setPassword(const QString& password);
|
||||||
|
void setNotes(const QString& notes);
|
||||||
|
|
||||||
void setGroup(Group* group);
|
void setGroup(Group* group);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user