diff --git a/src/core/EntryAttributes.cpp b/src/core/EntryAttributes.cpp index 66709b8e..df8823c2 100644 --- a/src/core/EntryAttributes.cpp +++ b/src/core/EntryAttributes.cpp @@ -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); } diff --git a/src/core/EntryAttributes.h b/src/core/EntryAttributes.h index 6f4dac8e..108b789c 100644 --- a/src/core/EntryAttributes.h +++ b/src/core/EntryAttributes.h @@ -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: diff --git a/src/core/Group.h b/src/core/Group.h index 52914152..ff987be2 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -114,6 +114,7 @@ private: void cleanupParent(); void recCreateDelObjects(); void updateTimeinfo(); + bool includeInSearch(bool resolveInherit); QPointer 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 diff --git a/src/core/Metadata.cpp b/src/core/Metadata.cpp index 52a7928f..db5b52f6 100644 --- a/src/core/Metadata.cpp +++ b/src/core/Metadata.cpp @@ -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 bool Metadata::set(P& property, const V& value) { diff --git a/src/core/Metadata.h b/src/core/Metadata.h index 07464fe6..7049b6db 100644 --- a/src/core/Metadata.h +++ b/src/core/Metadata.h @@ -70,8 +70,8 @@ public: int historyMaxSize() const; QHash 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); diff --git a/src/core/Uuid.cpp b/src/core/Uuid.cpp index eba0d7fd..871c8f9c 100644 --- a/src/core/Uuid.cpp +++ b/src/core/Uuid.cpp @@ -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); } diff --git a/src/core/Uuid.h b/src/core/Uuid.h index 2d422397..055bddb8 100644 --- a/src/core/Uuid.h +++ b/src/core/Uuid.h @@ -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: diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp index 8b4f8577..5942c907 100644 --- a/src/format/KeePass2Reader.cpp +++ b/src/format/KeePass2Reader.cpp @@ -247,7 +247,7 @@ bool KeePass2Reader::readHeaderField() void KeePass2Reader::setCipher(const QByteArray& data) { - if (data.size() != Uuid::LENGTH) { + if (data.size() != Uuid::Length) { raiseError(""); } else { diff --git a/src/format/KeePass2XmlReader.cpp b/src/format/KeePass2XmlReader.cpp index 76bdf5f6..8d06deae 100644 --- a/src/format/KeePass2XmlReader.cpp +++ b/src/format/KeePass2XmlReader.cpp @@ -848,7 +848,7 @@ int KeePass2XmlReader::readNumber() Uuid KeePass2XmlReader::readUuid() { QByteArray uuidBin = readBinary(); - if (uuidBin.length() != Uuid::LENGTH) { + if (uuidBin.length() != Uuid::Length) { raiseError(15); return Uuid(); } diff --git a/src/gui/DatabaseSettingsWidget.cpp b/src/gui/DatabaseSettingsWidget.cpp index 415370c9..d93073e7 100644 --- a/src/gui/DatabaseSettingsWidget.cpp +++ b/src/gui/DatabaseSettingsWidget.cpp @@ -60,7 +60,7 @@ void DatabaseSettingsWidget::setForms(const QString& dbName, const QString& dbDe m_ui->historyMaxItemsCheckBox->setChecked(true); } else { - m_ui->historyMaxItemsSpinBox->setValue(Metadata::defaultHistoryMaxItems); + m_ui->historyMaxItemsSpinBox->setValue(Metadata::DefaultHistoryMaxItems); m_ui->historyMaxItemsCheckBox->setChecked(false); } if (historyMaxSize > -1) { @@ -68,7 +68,7 @@ void DatabaseSettingsWidget::setForms(const QString& dbName, const QString& dbDe m_ui->historyMaxSizeCheckBox->setChecked(true); } else { - m_ui->historyMaxSizeSpinBox->setValue(Metadata::defaultHistoryMaxSize); + m_ui->historyMaxSizeSpinBox->setValue(Metadata::DefaultHistoryMaxSize); m_ui->historyMaxSizeCheckBox->setChecked(false); } diff --git a/src/gui/EditEntryWidget.cpp b/src/gui/EditEntryWidget.cpp index 4ee7e8b4..2a3d8132 100644 --- a/src/gui/EditEntryWidget.cpp +++ b/src/gui/EditEntryWidget.cpp @@ -125,9 +125,9 @@ EditEntryWidget::~EditEntryWidget() { } -const QColor EditEntryWidget::normalColor = Qt::white; -const QColor EditEntryWidget::correctSoFarColor = QColor(255, 205, 15); -const QColor EditEntryWidget::errorColor = QColor(255, 125, 125); +const QColor EditEntryWidget::NormalColor = Qt::white; +const QColor EditEntryWidget::CorrectSoFarColor = QColor(255, 205, 15); +const QColor EditEntryWidget::ErrorColor = QColor(255, 125, 125); void EditEntryWidget::loadEntry(Entry* entry, bool create, const QString& groupName, Database* database) @@ -284,14 +284,14 @@ void EditEntryWidget::setPasswordCheckColors() { QPalette pal; if (passwordsEqual()) { - pal.setColor(QPalette::Base, normalColor); + pal.setColor(QPalette::Base, NormalColor); } else { if (m_mainUi->passwordEdit->text().startsWith(m_mainUi->passwordRepeatEdit->text())) { - pal.setColor(QPalette::Base, correctSoFarColor); + pal.setColor(QPalette::Base, CorrectSoFarColor); } else { - pal.setColor(QPalette::Base, errorColor); + pal.setColor(QPalette::Base, ErrorColor); } } m_mainUi->passwordRepeatEdit->setPalette(pal); diff --git a/src/gui/EditEntryWidget.h b/src/gui/EditEntryWidget.h index 06eca528..7b766fd0 100644 --- a/src/gui/EditEntryWidget.h +++ b/src/gui/EditEntryWidget.h @@ -52,9 +52,9 @@ public: void loadEntry(Entry* entry, bool create, const QString& groupName, Database* database); - static const QColor normalColor; - static const QColor correctSoFarColor; - static const QColor errorColor; + static const QColor NormalColor; + static const QColor CorrectSoFarColor; + static const QColor ErrorColor; Q_SIGNALS: void editFinished(bool accepted); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d3e0db7e..dc7d3210 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -87,7 +87,7 @@ void MainWindow::openDatabase(const QString& fileName, const QString& pw, const m_ui->tabWidget->openDatabase(fileName, pw, keyFile); } -const QString MainWindow::m_baseWindowTitle = "KeePassX"; +const QString MainWindow::BaseWindowTitle = "KeePassX"; void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) { @@ -175,10 +175,10 @@ void MainWindow::updateWindowTitle() { int index = m_ui->tabWidget->currentIndex(); if (index == -1) { - setWindowTitle(m_baseWindowTitle); + setWindowTitle(BaseWindowTitle); } else { - setWindowTitle(m_ui->tabWidget->tabText(index).append(" - ").append(m_baseWindowTitle)); + setWindowTitle(m_ui->tabWidget->tabText(index).append(" - ").append(BaseWindowTitle)); } } diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 46227c50..d21e1ad3 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -44,8 +44,9 @@ private Q_SLOTS: void showAboutDialog(); private: + static const QString BaseWindowTitle; + const QScopedPointer m_ui; - static const QString m_baseWindowTitle; Q_DISABLE_COPY(MainWindow) }; diff --git a/src/streams/HashedBlockStream.cpp b/src/streams/HashedBlockStream.cpp index df4d9183..1085242c 100644 --- a/src/streams/HashedBlockStream.cpp +++ b/src/streams/HashedBlockStream.cpp @@ -22,7 +22,7 @@ #include "core/Endian.h" #include "crypto/CryptoHash.h" -const QSysInfo::Endian HashedBlockStream::BYTEORDER = QSysInfo::LittleEndian; +const QSysInfo::Endian HashedBlockStream::ByteOrder = QSysInfo::LittleEndian; HashedBlockStream::HashedBlockStream(QIODevice* baseDevice) : LayeredStream(baseDevice) @@ -126,7 +126,7 @@ bool HashedBlockStream::readHashedBlock() { bool ok; - quint32 index = Endian::readUInt32(m_baseDevice, BYTEORDER, &ok); + quint32 index = Endian::readUInt32(m_baseDevice, ByteOrder, &ok); if (!ok || index != m_blockIndex) { m_error = true; return false; @@ -138,7 +138,7 @@ bool HashedBlockStream::readHashedBlock() return false; } - m_blockSize = Endian::readInt32(m_baseDevice, BYTEORDER, &ok); + m_blockSize = Endian::readInt32(m_baseDevice, ByteOrder, &ok); if (!ok || m_blockSize < 0) { m_error = true; return false; @@ -207,7 +207,7 @@ qint64 HashedBlockStream::writeData(const char* data, qint64 maxSize) bool HashedBlockStream::writeHashedBlock() { - if (!Endian::writeInt32(m_blockIndex, m_baseDevice, BYTEORDER)) { + if (!Endian::writeInt32(m_blockIndex, m_baseDevice, ByteOrder)) { m_error = true; return false; } @@ -226,7 +226,7 @@ bool HashedBlockStream::writeHashedBlock() return false; } - if (!Endian::writeInt32(m_buffer.size(), m_baseDevice, BYTEORDER)) { + if (!Endian::writeInt32(m_buffer.size(), m_baseDevice, ByteOrder)) { m_error = true; return false; } diff --git a/src/streams/HashedBlockStream.h b/src/streams/HashedBlockStream.h index 75940d3c..3f9419ac 100644 --- a/src/streams/HashedBlockStream.h +++ b/src/streams/HashedBlockStream.h @@ -43,7 +43,7 @@ private: bool readHashedBlock(); bool writeHashedBlock(); - static const QSysInfo::Endian BYTEORDER; + static const QSysInfo::Endian ByteOrder; qint32 m_blockSize; QByteArray m_buffer; int m_bufferPos;