Coding style improvements.
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
|
||||
#include "EntryAttributes.h"
|
||||
|
||||
const QStringList EntryAttributes::DEFAULT_ATTRIBUTES(QStringList() << "Title" << "URL"
|
||||
<< "UserName" << "Password" << "Notes");
|
||||
const QStringList EntryAttributes::DefaultAttributes(QStringList() << "Title" << "URL"
|
||||
<< "UserName" << "Password" << "Notes");
|
||||
|
||||
EntryAttributes::EntryAttributes(QObject* parent)
|
||||
: QObject(parent)
|
||||
@@ -215,7 +215,7 @@ void EntryAttributes::clear()
|
||||
m_attributes.clear();
|
||||
m_protectedAttributes.clear();
|
||||
|
||||
Q_FOREACH (const QString& key, DEFAULT_ATTRIBUTES) {
|
||||
Q_FOREACH (const QString& key, DefaultAttributes) {
|
||||
m_attributes.insert(key, "");
|
||||
}
|
||||
|
||||
@@ -236,5 +236,5 @@ int EntryAttributes::attributesSize() {
|
||||
|
||||
bool EntryAttributes::isDefaultAttribute(const QString& key)
|
||||
{
|
||||
return DEFAULT_ATTRIBUTES.contains(key);
|
||||
return DefaultAttributes.contains(key);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
bool operator==(const EntryAttributes& other) const;
|
||||
bool operator!=(const EntryAttributes& other) const;
|
||||
|
||||
static const QStringList DEFAULT_ATTRIBUTES;
|
||||
static const QStringList DefaultAttributes;
|
||||
static bool isDefaultAttribute(const QString& key);
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
@@ -114,6 +114,7 @@ private:
|
||||
void cleanupParent();
|
||||
void recCreateDelObjects();
|
||||
void updateTimeinfo();
|
||||
bool includeInSearch(bool resolveInherit);
|
||||
|
||||
QPointer<Database> m_db;
|
||||
Uuid m_uuid;
|
||||
@@ -138,8 +139,6 @@ private:
|
||||
friend void Database::setRootGroup(Group* group);
|
||||
friend Entry::~Entry();
|
||||
friend void Entry::setGroup(Group* group);
|
||||
|
||||
bool includeInSearch(bool resolveInherit);
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_GROUP_H
|
||||
|
||||
@@ -29,8 +29,8 @@ Metadata::Metadata(QObject* parent)
|
||||
m_recycleBinEnabled = true;
|
||||
m_masterKeyChangeRec = -1;
|
||||
m_masterKeyChangeForce = -1;
|
||||
m_historyMaxItems = defaultHistoryMaxItems;
|
||||
m_historyMaxSize = defaultHistoryMaxSize;
|
||||
m_historyMaxItems = DefaultHistoryMaxItems;
|
||||
m_historyMaxSize = DefaultHistoryMaxSize;
|
||||
|
||||
QDateTime now = Tools::currentDateTimeUtc();
|
||||
m_nameChanged = now;
|
||||
@@ -50,8 +50,8 @@ Metadata::Metadata(QObject* parent)
|
||||
m_updateDatetime = true;
|
||||
}
|
||||
|
||||
const int Metadata::defaultHistoryMaxItems = 10;
|
||||
const int Metadata::defaultHistoryMaxSize = 6291456;
|
||||
const int Metadata::DefaultHistoryMaxItems = 10;
|
||||
const int Metadata::DefaultHistoryMaxSize = 6291456;
|
||||
|
||||
template <class P, class V> bool Metadata::set(P& property, const V& value)
|
||||
{
|
||||
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
int historyMaxSize() const;
|
||||
QHash<QString, QString> customFields() const;
|
||||
|
||||
static const int defaultHistoryMaxItems;
|
||||
static const int defaultHistoryMaxSize;
|
||||
static const int DefaultHistoryMaxItems;
|
||||
static const int DefaultHistoryMaxSize;
|
||||
|
||||
void setGenerator(const QString& value);
|
||||
void setName(const QString& value);
|
||||
|
||||
@@ -21,22 +21,22 @@
|
||||
|
||||
#include "crypto/Random.h"
|
||||
|
||||
const int Uuid::LENGTH = 16;
|
||||
const int Uuid::Length = 16;
|
||||
|
||||
Uuid::Uuid()
|
||||
: m_data(LENGTH, 0)
|
||||
: m_data(Length, 0)
|
||||
{
|
||||
}
|
||||
|
||||
Uuid::Uuid(const QByteArray& data)
|
||||
{
|
||||
Q_ASSERT(data.size() == LENGTH);
|
||||
Q_ASSERT(data.size() == Length);
|
||||
|
||||
m_data = data;
|
||||
}
|
||||
|
||||
Uuid Uuid::random() {
|
||||
return Uuid(Random::randomArray(LENGTH));
|
||||
return Uuid(Random::randomArray(Length));
|
||||
}
|
||||
|
||||
QString Uuid::toBase64() const
|
||||
@@ -97,7 +97,7 @@ QDataStream& operator>>(QDataStream& stream, Uuid& uuid)
|
||||
{
|
||||
QByteArray data;
|
||||
stream >> data;
|
||||
if (data.size() == Uuid::LENGTH) {
|
||||
if (data.size() == Uuid::Length) {
|
||||
uuid = Uuid(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
Uuid& operator=(const Uuid& other);
|
||||
bool operator==(const Uuid& other) const;
|
||||
bool operator!=(const Uuid& other) const;
|
||||
static const int LENGTH;
|
||||
static const int Length;
|
||||
static Uuid fromBase64(const QString& str);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user