0
0
mirror of https://github.com/keepassxreboot/keepassxc.git synced 2024-09-20 12:22:16 +02:00

Rename addAttribute() to setAttribute() and addAttachment() to setAttachment().

This commit is contained in:
Felix Geyer 2012-01-07 16:22:11 +01:00
parent 40e96ad7b3
commit e397080d79
4 changed files with 13 additions and 13 deletions

View File

@ -34,7 +34,7 @@ Entry::Entry()
m_autoTypeObfuscation = 0;
Q_FOREACH (const QString& key, m_defaultAttibutes) {
addAttribute(key, "");
setAttribute(key, "");
}
}
@ -252,7 +252,7 @@ void Entry::addAutoTypeAssociation(const AutoTypeAssociation& assoc)
m_autoTypeAssociations << assoc;
}
void Entry::addAttribute(const QString& key, const QString& value, bool protect)
void Entry::setAttribute(const QString& key, const QString& value, bool protect)
{
m_attributes.insert(key, value);
if (protect) {
@ -272,7 +272,7 @@ void Entry::removeAttribute(const QString& key)
m_protectedAttributes.remove(key);
}
void Entry::addAttachment(const QString& key, const QByteArray& value, bool protect)
void Entry::setAttachment(const QString& key, const QByteArray& value, bool protect)
{
m_binaries.insert(key, value);
if (protect) {
@ -288,27 +288,27 @@ void Entry::removeAttachment(const QString& key)
void Entry::setTitle(const QString& title)
{
addAttribute("Title", title);
setAttribute("Title", title);
}
void Entry::setUrl(const QString& url)
{
addAttribute("URL", url);
setAttribute("URL", url);
}
void Entry::setUsername(const QString& username)
{
addAttribute("UserName", username);
setAttribute("UserName", username);
}
void Entry::setPassword(const QString& password)
{
addAttribute("Password", password);
setAttribute("Password", password);
}
void Entry::setNotes(const QString& notes)
{
addAttribute("Notes", notes);
setAttribute("Notes", notes);
}
QList<Entry*> Entry::historyItems()

View File

@ -82,9 +82,9 @@ public:
void setAutoTypeObfuscation(int obfuscation);
void setDefaultAutoTypeSequence(const QString& sequence);
void addAutoTypeAssociation(const AutoTypeAssociation& assoc);
void addAttribute(const QString& key, const QString& value, bool protect = false);
void setAttribute(const QString& key, const QString& value, bool protect = false);
void removeAttribute(const QString& key);
void addAttachment(const QString& key, const QByteArray& value, bool protect = false);
void setAttachment(const QString& key, const QByteArray& value, bool protect = false);
void removeAttachment(const QString& key);
void setTitle(const QString& title);
void setUrl(const QString& url);

View File

@ -537,7 +537,7 @@ void KeePass2XmlReader::parseEntryString(Entry *entry)
}
}
entry->addAttribute(key, value, isProtected);
entry->setAttribute(key, value, isProtected);
}
else {
skipCurrentElement();
@ -564,7 +564,7 @@ void KeePass2XmlReader::parseEntryBinary(Entry *entry)
m_randomStream->processInPlace(value);
}
entry->addAttachment(key, value, isProtected);
entry->setAttachment(key, value, isProtected);
}
else {
skipCurrentElement();

View File

@ -43,7 +43,7 @@ void TestKeePass2Writer::initTestCase()
group->setUuid(Uuid::random());
Entry* entry = new Entry();
entry->setUuid(Uuid::random());
entry->addAttribute("test", "protectedTest", true);
entry->setAttribute("test", "protectedTest", true);
QVERIFY(entry->isAttributeProtected("test"));
entry->setGroup(group);
Group* groupNew = new Group();