From f1719cfc5f6b59a5b342aca4a6d015face1f87ed Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 28 Oct 2012 11:27:10 +0100 Subject: [PATCH] Small optimizations. --- src/format/KeePass1Reader.cpp | 8 ++++---- src/format/KeePass1Reader.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/format/KeePass1Reader.cpp b/src/format/KeePass1Reader.cpp index 3ecf2332e..f94e3fa76 100644 --- a/src/format/KeePass1Reader.cpp +++ b/src/format/KeePass1Reader.cpp @@ -85,13 +85,13 @@ Database* KeePass1Reader::readDatabase(QIODevice* device, const QString& passwor bool ok; quint32 signature1 = Endian::readUInt32(m_device, KeePass1::BYTEORDER, &ok); - if (!ok || signature1 != 0x9AA2D903) { + if (!ok || signature1 != KeePass1::SIGNATURE_1) { raiseError(tr("Not a KeePass database.")); return Q_NULLPTR; } quint32 signature2 = Endian::readUInt32(m_device, KeePass1::BYTEORDER, &ok); - if (!ok || signature2 != 0xB54BFB65) { + if (!ok || signature2 != KeePass1::SIGNATURE_2) { raiseError(tr("Not a KeePass database.")); return Q_NULLPTR; } @@ -705,7 +705,7 @@ void KeePass1Reader::parseNotes(const QString& rawNotes, Entry* entry) } } -bool KeePass1Reader::constructGroupTree(const QList groups) +bool KeePass1Reader::constructGroupTree(const QList& groups) { for (int i = 0; i < groups.size(); i++) { quint32 level = m_groupLevels.value(groups[i]); @@ -726,7 +726,7 @@ bool KeePass1Reader::constructGroupTree(const QList groups) } } - if (groups[i]->parent() == m_tmpParent) { + if (groups[i]->parentGroup() == m_tmpParent) { return false; } } diff --git a/src/format/KeePass1Reader.h b/src/format/KeePass1Reader.h index 643587484..208bd4b52 100644 --- a/src/format/KeePass1Reader.h +++ b/src/format/KeePass1Reader.h @@ -58,7 +58,7 @@ private: Group* readGroup(QIODevice* cipherStream); Entry* readEntry(QIODevice* cipherStream); void parseNotes(const QString& rawNotes, Entry* entry); - bool constructGroupTree(const QList groups); + bool constructGroupTree(const QList& groups); void parseMetaStream(const Entry* entry); bool parseGroupTreeState(const QByteArray& data); bool parseCustomIcons4(const QByteArray& data);