From 782223a643fd09edc58f4407bb4d8357003f07cf Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 1 Jul 2012 21:58:45 +0200 Subject: [PATCH] Coding style fixes. --- src/core/Entry.cpp | 4 ++-- src/core/Group.cpp | 4 ++-- src/core/Metadata.cpp | 6 +++--- tests/TestKeePass2RandomStream.cpp | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index dd41d90e7..8e5499f24 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -23,6 +23,8 @@ #include "core/Metadata.h" #include "core/Tools.h" +const int Entry::DefaultIconNumber = 0; + Entry::Entry() { m_updateTimeinfo = true; @@ -56,8 +58,6 @@ Entry::~Entry() qDeleteAll(m_history); } -const int Entry::DefaultIconNumber = 0; - template bool Entry::set(T& property, const T& value) { if (property != value) { diff --git a/src/core/Group.cpp b/src/core/Group.cpp index fd4f981dd..ccd3bf255 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -22,6 +22,8 @@ #include "core/Metadata.h" #include "core/Tools.h" +const int Group::DefaultIconNumber = 48; + Group::Group() { m_iconNumber = DefaultIconNumber; @@ -56,8 +58,6 @@ Group::~Group() } } -const int Group::DefaultIconNumber = 48; - template bool Group::set(P& property, const V& value) { if (property != value) { property = value; diff --git a/src/core/Metadata.cpp b/src/core/Metadata.cpp index a033c60f8..db45826c8 100644 --- a/src/core/Metadata.cpp +++ b/src/core/Metadata.cpp @@ -21,6 +21,9 @@ #include "core/Group.h" #include "core/Tools.h" +const int Metadata::DefaultHistoryMaxItems = 10; +const int Metadata::DefaultHistoryMaxSize = 6 * 1024 * 1024; + Metadata::Metadata(QObject* parent) : QObject(parent) { @@ -50,9 +53,6 @@ Metadata::Metadata(QObject* parent) m_updateDatetime = true; } -const int Metadata::DefaultHistoryMaxItems = 10; -const int Metadata::DefaultHistoryMaxSize = 6291456; - template bool Metadata::set(P& property, const V& value) { if (property != value) { diff --git a/tests/TestKeePass2RandomStream.cpp b/tests/TestKeePass2RandomStream.cpp index 5e2e381cb..f3523bcf6 100644 --- a/tests/TestKeePass2RandomStream.cpp +++ b/tests/TestKeePass2RandomStream.cpp @@ -34,7 +34,7 @@ void TestKeePass2RandomStream::initTestCase() void TestKeePass2RandomStream::test() { const QByteArray key("\x11\x22\x33\x44\x55\x66\x77\x88"); - const int SIZE = 128; + const int Size = 128; SymmetricCipher cipher(SymmetricCipher::Salsa20, SymmetricCipher::Stream, SymmetricCipher::Encrypt, @@ -46,13 +46,13 @@ void TestKeePass2RandomStream::test() "1e36b26bd1ebc670d1bd1d665620abf74f78a7f6d29809585a97daec58c6b050")); QByteArray cipherPad; - cipherPad.fill('\0', SIZE); + cipherPad.fill('\0', Size); cipher.processInPlace(cipherPad); QByteArray cipherData; - cipherData.resize(SIZE); + cipherData.resize(Size); - for (int i = 0; i < SIZE; i++) { + for (int i = 0; i < Size; i++) { cipherData[i] = data[i] ^ cipherPad[i]; } @@ -73,7 +73,7 @@ void TestKeePass2RandomStream::test() QByteArray cipherDataEncrypt = cipherEncrypt.process(data); - QCOMPARE(randomStreamData.size(), SIZE); + QCOMPARE(randomStreamData.size(), Size); QCOMPARE(cipherData, cipherDataEncrypt); QCOMPARE(randomStreamData, cipherData); }