diff --git a/src/core/Config.cpp b/src/core/Config.cpp index c06b4f423..91b8311c5 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -53,7 +53,7 @@ Config::Config() userPath += "/keepassx/"; #elif defined(Q_WS_MAC) - // TODO where to store the config on mac? + // TODO: where to store the config on mac? userPath = homePath; userPath += "/.keepassx/"; #elif defined(Q_WS_WIN) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index fb5926ecc..efbd6ccad 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -92,7 +92,7 @@ QImage Entry::icon() const return databaseIcons()->icon(m_data.iconNumber); } else { - // TODO check if database() is 0 + // TODO: check if database() is 0 return database()->metadata()->customIcon(m_data.customIcon); } } @@ -105,7 +105,7 @@ QPixmap Entry::iconPixmap() const else { QPixmap pixmap; if (!QPixmapCache::find(m_pixmapCacheKey, &pixmap)) { - // TODO check if database() is 0 + // TODO: check if database() is 0 pixmap = QPixmap::fromImage(database()->metadata()->customIcon(m_data.customIcon)); *const_cast(&m_pixmapCacheKey) = QPixmapCache::insert(pixmap); } diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 93060fe4f..2a5815c7e 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -100,7 +100,7 @@ QImage Group::icon() const return databaseIcons()->icon(m_iconNumber); } else { - // TODO check if m_db is 0 + // TODO: check if m_db is 0 return m_db->metadata()->customIcon(m_customIcon); } } @@ -113,7 +113,7 @@ QPixmap Group::iconPixmap() const else { QPixmap pixmap; if (!QPixmapCache::find(m_pixmapCacheKey, &pixmap)) { - // TODO check if m_db is 0 + // TODO: check if m_db is 0 pixmap = QPixmap::fromImage(m_db->metadata()->customIcon(m_customIcon)); *const_cast(&m_pixmapCacheKey) = QPixmapCache::insert(pixmap); } diff --git a/src/crypto/CryptoHash.cpp b/src/crypto/CryptoHash.cpp index c9459598e..f175b7754 100644 --- a/src/crypto/CryptoHash.cpp +++ b/src/crypto/CryptoHash.cpp @@ -48,7 +48,7 @@ CryptoHash::CryptoHash(CryptoHash::Algorithm algo) } gcry_error_t error = gcry_md_open(&d->ctx, algoGcrypt, 0); - Q_ASSERT(error == 0); // TODO error handling + Q_ASSERT(error == 0); // TODO: error handling d->hashLen = gcry_md_get_algo_dlen(algoGcrypt); } diff --git a/src/crypto/SymmetricCipherGcrypt.cpp b/src/crypto/SymmetricCipherGcrypt.cpp index 4324a28a0..94a24429e 100644 --- a/src/crypto/SymmetricCipherGcrypt.cpp +++ b/src/crypto/SymmetricCipherGcrypt.cpp @@ -68,7 +68,7 @@ void SymmetricCipherGcrypt::init() gcry_error_t error; error = gcry_cipher_open(&m_ctx, m_algo, m_mode, 0); - Q_ASSERT(error == 0); // TODO real error checking + Q_ASSERT(error == 0); // TODO: real error checking size_t blockSizeT; error = gcry_cipher_algo_info(m_algo, GCRYCTL_GET_BLKLEN, 0, &blockSizeT); @@ -92,7 +92,7 @@ void SymmetricCipherGcrypt::setIv(const QByteArray& iv) QByteArray SymmetricCipherGcrypt::process(const QByteArray& data) { - // TODO check block size + // TODO: check block size QByteArray result; result.resize(data.size()); @@ -113,7 +113,7 @@ QByteArray SymmetricCipherGcrypt::process(const QByteArray& data) void SymmetricCipherGcrypt::processInPlace(QByteArray& data) { - // TODO check block size + // TODO: check block size gcry_error_t error; @@ -129,7 +129,7 @@ void SymmetricCipherGcrypt::processInPlace(QByteArray& data) void SymmetricCipherGcrypt::processInPlace(QByteArray& data, quint64 rounds) { - // TODO check block size + // TODO: check block size gcry_error_t error; diff --git a/src/format/KeePass1Reader.cpp b/src/format/KeePass1Reader.cpp index f69febd2c..aa12bec68 100644 --- a/src/format/KeePass1Reader.cpp +++ b/src/format/KeePass1Reader.cpp @@ -111,49 +111,49 @@ Database* KeePass1Reader::readDatabase(QIODevice* device, const QString& passwor m_masterSeed = m_device->read(16); if (m_masterSeed.size() != 16) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } m_encryptionIV = m_device->read(16); if (m_encryptionIV.size() != 16) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } quint32 numGroups = Endian::readUInt32(m_device, KeePass1::BYTEORDER, &ok); if (!ok) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } quint32 numEntries = Endian::readUInt32(m_device, KeePass1::BYTEORDER, &ok); if (!ok) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } m_contentHashHeader = m_device->read(32); if (m_contentHashHeader.size() != 32) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } m_transformSeed = m_device->read(32); if (m_transformSeed.size() != 32) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } m_transformRounds = Endian::readUInt32(m_device, KeePass1::BYTEORDER, &ok); if (!ok) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } @@ -164,7 +164,7 @@ Database* KeePass1Reader::readDatabase(QIODevice* device, const QString& passwor QScopedPointer cipherStream(testKeys(password, keyfileData, contentPos)); if (!cipherStream) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } @@ -330,7 +330,7 @@ SymmetricCipherStream* KeePass1Reader::testKeys(const QString& password, const Q cipherStream->reset(); cipherStream->close(); if (!m_device->seek(contentPos)) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } @@ -400,7 +400,7 @@ Group* KeePass1Reader::readGroup(QIODevice* cipherStream) QByteArray fieldData = cipherStream->read(fieldSize); if (fieldData.size() != fieldSize) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } @@ -524,7 +524,7 @@ Entry* KeePass1Reader::readEntry(QIODevice* cipherStream) QByteArray fieldData = cipherStream->read(fieldSize); if (fieldData.size() != fieldSize) { - // TODO error + // TODO: error Q_ASSERT(false); return 0; } diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp index a4e58a681..8b4f8577c 100644 --- a/src/format/KeePass2Reader.cpp +++ b/src/format/KeePass2Reader.cpp @@ -69,7 +69,7 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke while (readHeaderField() && !hasError()) { } - // TODO check if all header fields have been parsed + // TODO: check if all header fields have been parsed m_db->setKey(key, m_transformSeed, false); diff --git a/src/format/KeePass2XmlWriter.cpp b/src/format/KeePass2XmlWriter.cpp index 034ca548a..0662098f3 100644 --- a/src/format/KeePass2XmlWriter.cpp +++ b/src/format/KeePass2XmlWriter.cpp @@ -146,7 +146,7 @@ void KeePass2XmlWriter::writeIcon(const Uuid& uuid, const QImage& icon) QByteArray ba; QBuffer buffer(&ba); buffer.open(QIODevice::WriteOnly); - // TODO check !icon.save() + // TODO: check !icon.save() icon.save(&buffer, "PNG"); buffer.close(); writeBinary("Data", ba); diff --git a/src/gui/ChangeMasterKeyWidget.cpp b/src/gui/ChangeMasterKeyWidget.cpp index 93601e3f9..d22e07746 100644 --- a/src/gui/ChangeMasterKeyWidget.cpp +++ b/src/gui/ChangeMasterKeyWidget.cpp @@ -53,7 +53,7 @@ void ChangeMasterKeyWidget::clearForms() m_ui->repeatPasswordEdit->setText(""); m_ui->keyFileGroup->setChecked(false); m_ui->togglePasswordButton->setChecked(true); - // TODO clear m_ui->keyFileCombo + // TODO: clear m_ui->keyFileCombo m_ui->enterPasswordEdit->setFocus(); } @@ -94,7 +94,7 @@ void ChangeMasterKeyWidget::generateKey() FileKey fileKey; QString errorMsg; if (!fileKey.load(m_ui->keyFileCombo->currentText(), &errorMsg)) { - // TODO error handling + // TODO: error handling } m_key.addKey(fileKey); } diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index 1c8c19713..d2ce62eec 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -84,7 +84,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw, const QString& keyFile) { QScopedPointer file(new QFile(fileName)); - // TODO error handling + // TODO: error handling if (!file->open(QIODevice::ReadWrite)) { if (!file->open(QIODevice::ReadOnly)) { // can't open @@ -208,7 +208,7 @@ void DatabaseTabWidget::saveDatabase(Database* db) { DatabaseManagerStruct& dbStruct = m_dbList[db]; - // TODO ensure that the data is actually written to disk + // TODO: ensure that the data is actually written to disk if (dbStruct.file) { dbStruct.file->reset(); m_writer.writeDatabase(dbStruct.file, db); @@ -235,12 +235,12 @@ void DatabaseTabWidget::saveDatabaseAs(Database* db) if (!fileName.isEmpty()) { QFile* oldFile = dbStruct.file; QScopedPointer file(new QFile(fileName)); - // TODO error handling + // TODO: error handling if (!file->open(QIODevice::ReadWrite)) { return; } dbStruct.file = file.take(); - // TODO ensure that the data is actually written to disk + // TODO: ensure that the data is actually written to disk m_writer.writeDatabase(dbStruct.file, db); dbStruct.file->flush(); delete oldFile; diff --git a/src/gui/EditEntryWidget.cpp b/src/gui/EditEntryWidget.cpp index 163912e0a..94f9c0169 100644 --- a/src/gui/EditEntryWidget.cpp +++ b/src/gui/EditEntryWidget.cpp @@ -360,7 +360,7 @@ void EditEntryWidget::updateCurrentAttribute() void EditEntryWidget::insertAttachment() { - // TODO save last used dir + // TODO: save last used dir QString filename = fileDialog()->getOpenFileName(this, tr("Select file"), QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)); if (filename.isEmpty() || !QFile::exists(filename)) { @@ -392,7 +392,7 @@ void EditEntryWidget::saveCurrentAttachment() } QString filename = m_attachmentsModel->keyByIndex(index); - // TODO save last used dir + // TODO: save last used dir QDir dir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)); QString savePath = fileDialog()->getSaveFileName(this, tr("Save attachment"), dir.filePath(filename)); diff --git a/src/gui/EntryView.cpp b/src/gui/EntryView.cpp index 4b216c8b3..470551799 100644 --- a/src/gui/EntryView.cpp +++ b/src/gui/EntryView.cpp @@ -63,7 +63,7 @@ void EntryView::setModel(QAbstractItemModel* model) Entry* EntryView::currentEntry() { - // TODO use selection instead of current? + // TODO: use selection instead of current? return m_model->entryFromIndex(m_sortModel->mapToSource(currentIndex())); } diff --git a/src/keys/FileKey.cpp b/src/keys/FileKey.cpp index b22c5b0f2..46f63f162 100644 --- a/src/keys/FileKey.cpp +++ b/src/keys/FileKey.cpp @@ -192,7 +192,7 @@ bool FileKey::loadXmlMeta(QXmlStreamReader& xmlReader) while (!xmlReader.error() && xmlReader.readNextStartElement()) { if (xmlReader.name() == "Version") { - // TODO error message about incompatible key file version + // TODO: error message about incompatible key file version if (xmlReader.readElementText() == "1.00") { corectVersion = true; } @@ -208,7 +208,7 @@ QByteArray FileKey::loadXmlKey(QXmlStreamReader& xmlReader) while (!xmlReader.error() && xmlReader.readNextStartElement()) { if (xmlReader.name() == "Data") { - // TODO do we need to enforce a specific data.size()? + // TODO: do we need to enforce a specific data.size()? data = QByteArray::fromBase64(xmlReader.readElementText().toAscii()); } } diff --git a/src/streams/SymmetricCipherStream.cpp b/src/streams/SymmetricCipherStream.cpp index fc364e83c..a6f5b1f5e 100644 --- a/src/streams/SymmetricCipherStream.cpp +++ b/src/streams/SymmetricCipherStream.cpp @@ -191,7 +191,7 @@ bool SymmetricCipherStream::writeBlock(bool lastBlock) if (m_baseDevice->write(m_buffer) != m_buffer.size()) { m_error = true; - // TODO copy error string + // TODO: copy error string return false; } else { diff --git a/tests/TestCryptoHash.cpp b/tests/TestCryptoHash.cpp index cabb545a8..35bd72e0f 100644 --- a/tests/TestCryptoHash.cpp +++ b/tests/TestCryptoHash.cpp @@ -30,7 +30,7 @@ void TestCryptoHash::initTestCase() void TestCryptoHash::test() { - // TODO move somewhere else + // TODO: move somewhere else QVERIFY(Crypto::selfTest()); CryptoHash cryptoHash1(CryptoHash::Sha256); diff --git a/tests/TestKeePass2XmlReader.cpp b/tests/TestKeePass2XmlReader.cpp index bbd53a7e9..586d8db4c 100644 --- a/tests/TestKeePass2XmlReader.cpp +++ b/tests/TestKeePass2XmlReader.cpp @@ -268,7 +268,7 @@ void TestKeePass2XmlReader::testEntry2() QCOMPARE(entry->uuid().toBase64(), QString("4jbADG37hkiLh2O0qUdaOQ==")); QCOMPARE(entry->iconNumber(), 0); QCOMPARE(entry->iconUuid().toBase64(), QString("++vyI+daLk6omox4a6kQGA==")); - // TODO test entry->icon() + // TODO: test entry->icon() QCOMPARE(entry->foregroundColor(), QColor(255, 0, 0)); QCOMPARE(entry->backgroundColor(), QColor(255, 255, 0)); QCOMPARE(entry->overrideUrl(), QString("http://override.net/")); @@ -284,7 +284,7 @@ void TestKeePass2XmlReader::testEntry2() QVERIFY(attrs.removeOne("Notes")); QCOMPARE(entry->attributes()->value("Password"), QString("Jer60Hz8o9XHvxBGcRqT")); QVERIFY(attrs.removeOne("Password")); - QCOMPARE(entry->attributes()->value("Protected String"), QString("y")); // TODO should have a protection attribute + QCOMPARE(entry->attributes()->value("Protected String"), QString("y")); // TODO: should have a protection attribute QVERIFY(attrs.removeOne("Protected String")); QCOMPARE(entry->attributes()->value("Title"), QString("Sample Entry 2")); QVERIFY(attrs.removeOne("Title"));