From e397080d798436344c6a7a07cb3aa0cd97483184 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 7 Jan 2012 16:22:11 +0100 Subject: [PATCH] Rename addAttribute() to setAttribute() and addAttachment() to setAttachment(). --- src/core/Entry.cpp | 16 ++++++++-------- src/core/Entry.h | 4 ++-- src/format/KeePass2XmlReader.cpp | 4 ++-- tests/TestKeePass2Writer.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index bf0387023..162685492 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -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::historyItems() diff --git a/src/core/Entry.h b/src/core/Entry.h index 0e2e64e95..70ee3b7a0 100644 --- a/src/core/Entry.h +++ b/src/core/Entry.h @@ -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); diff --git a/src/format/KeePass2XmlReader.cpp b/src/format/KeePass2XmlReader.cpp index 4c4efa1da..d00084ac4 100644 --- a/src/format/KeePass2XmlReader.cpp +++ b/src/format/KeePass2XmlReader.cpp @@ -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(); diff --git a/tests/TestKeePass2Writer.cpp b/tests/TestKeePass2Writer.cpp index a844b004e..bda8b2735 100644 --- a/tests/TestKeePass2Writer.cpp +++ b/tests/TestKeePass2Writer.cpp @@ -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();