mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Code format fixes
This commit is contained in:
parent
0423bbe168
commit
7b95867378
@ -606,8 +606,7 @@ BrowserService::searchEntries(const QSharedPointer<Database>& db, const QString&
|
|||||||
// Search for additional URL's starting with KP2A_URL
|
// Search for additional URL's starting with KP2A_URL
|
||||||
if (entry->attributes()->keys().contains(ADDITIONAL_URL)) {
|
if (entry->attributes()->keys().contains(ADDITIONAL_URL)) {
|
||||||
for (const auto& key : entry->attributes()->keys()) {
|
for (const auto& key : entry->attributes()->keys()) {
|
||||||
if (key.startsWith(ADDITIONAL_URL)
|
if (key.startsWith(ADDITIONAL_URL) && handleURL(entry->attributes()->value(key), domain, url)) {
|
||||||
&& handleURL(entry->attributes()->value(key), domain, url)) {
|
|
||||||
entries.append(entry);
|
entries.append(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1029,7 +1028,8 @@ bool BrowserService::handleURL(const QString& entryUrl, const QString& hostname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Match scheme
|
// Match scheme
|
||||||
if (browserSettings()->matchUrlScheme() && !entryQUrl.scheme().isEmpty() && entryQUrl.scheme().compare(qUrl.scheme()) != 0) {
|
if (browserSettings()->matchUrlScheme() && !entryQUrl.scheme().isEmpty()
|
||||||
|
&& entryQUrl.scheme().compare(qUrl.scheme()) != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,8 +55,7 @@ int Analyze::executeWithDatabase(QSharedPointer<Database> database, QSharedPoint
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputTextStream << QObject::tr("Evaluating database entries against HIBP file, this will take a while...")
|
outputTextStream << QObject::tr("Evaluating database entries against HIBP file, this will take a while...") << endl;
|
||||||
<< endl;
|
|
||||||
|
|
||||||
QList<QPair<const Entry*, int>> findings;
|
QList<QPair<const Entry*, int>> findings;
|
||||||
QString error;
|
QString error;
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "crypto/kdf/AesKdf.h"
|
#include "crypto/kdf/AesKdf.h"
|
||||||
#include "crypto/kdf/Kdf.h"
|
#include "crypto/kdf/Kdf.h"
|
||||||
#include "format/KeePass2.h"
|
#include "format/KeePass2.h"
|
||||||
#include "keys/PasswordKey.h"
|
|
||||||
#include "keys/CompositeKey.h"
|
#include "keys/CompositeKey.h"
|
||||||
|
#include "keys/PasswordKey.h"
|
||||||
|
|
||||||
class Entry;
|
class Entry;
|
||||||
enum class EntryReferenceType;
|
enum class EntryReferenceType;
|
||||||
|
@ -370,8 +370,10 @@ void DatabaseOpenWidget::browseKeyFile()
|
|||||||
QString filename = fileDialog()->getOpenFileName(this, tr("Select key file"), QString(), filters);
|
QString filename = fileDialog()->getOpenFileName(this, tr("Select key file"), QString(), filters);
|
||||||
|
|
||||||
if (QFileInfo(filename).canonicalFilePath() == QFileInfo(m_filename).canonicalFilePath()) {
|
if (QFileInfo(filename).canonicalFilePath() == QFileInfo(m_filename).canonicalFilePath()) {
|
||||||
MessageBox::warning(this, tr("Cannot use database file as key file"),
|
MessageBox::warning(this,
|
||||||
tr("You cannot use your database file as a key file.\nIf you do not have a key file, please leave the field empty."),
|
tr("Cannot use database file as key file"),
|
||||||
|
tr("You cannot use your database file as a key file.\nIf you do not have a key file, "
|
||||||
|
"please leave the field empty."),
|
||||||
MessageBox::Button::Ok);
|
MessageBox::Button::Ok);
|
||||||
filename = "";
|
filename = "";
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,8 @@ void DatabaseTabWidget::addDatabaseTab(const QString& filePath,
|
|||||||
for (int i = 0, c = count(); i < c; ++i) {
|
for (int i = 0, c = count(); i < c; ++i) {
|
||||||
auto* dbWidget = databaseWidgetFromIndex(i);
|
auto* dbWidget = databaseWidgetFromIndex(i);
|
||||||
Q_ASSERT(dbWidget);
|
Q_ASSERT(dbWidget);
|
||||||
if (dbWidget && dbWidget->database()->canonicalFilePath().compare(canonicalFilePath, FILE_CASE_SENSITIVE) == 0) {
|
if (dbWidget
|
||||||
|
&& dbWidget->database()->canonicalFilePath().compare(canonicalFilePath, FILE_CASE_SENSITIVE) == 0) {
|
||||||
dbWidget->performUnlockDatabase(password, keyfile);
|
dbWidget->performUnlockDatabase(password, keyfile);
|
||||||
if (!inBackground) {
|
if (!inBackground) {
|
||||||
// switch to existing tab if file is already open
|
// switch to existing tab if file is already open
|
||||||
|
@ -48,4 +48,3 @@ const QSharedPointer<Database> DatabaseSettingsWidget::getDatabase() const
|
|||||||
{
|
{
|
||||||
return m_db;
|
return m_db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ class KeyFileEditWidget : public KeyComponentWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KeyFileEditWidget(DatabaseSettingsWidget* parent);
|
explicit KeyFileEditWidget(DatabaseSettingsWidget* parent);
|
||||||
Q_DISABLE_COPY(KeyFileEditWidget);
|
Q_DISABLE_COPY(KeyFileEditWidget);
|
||||||
|
@ -400,7 +400,6 @@ void TestBrowser::testSortEntries()
|
|||||||
QCOMPARE(result[2]->url(), QString("https://github.com/login"));
|
QCOMPARE(result[2]->url(), QString("https://github.com/login"));
|
||||||
QCOMPARE(result[3]->username(), QString("User 3"));
|
QCOMPARE(result[3]->username(), QString("User 3"));
|
||||||
QCOMPARE(result[3]->url(), QString("github.com/login"));
|
QCOMPARE(result[3]->url(), QString("github.com/login"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestBrowser::testGetDatabaseGroups()
|
void TestBrowser::testGetDatabaseGroups()
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
#include "core/Global.h"
|
#include "core/Global.h"
|
||||||
#include "core/Tools.h"
|
#include "core/Tools.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "keys/drivers/YubiKey.h"
|
|
||||||
#include "format/Kdbx3Reader.h"
|
#include "format/Kdbx3Reader.h"
|
||||||
#include "format/Kdbx3Writer.h"
|
#include "format/Kdbx3Writer.h"
|
||||||
#include "format/Kdbx4Reader.h"
|
#include "format/Kdbx4Reader.h"
|
||||||
#include "format/Kdbx4Writer.h"
|
#include "format/Kdbx4Writer.h"
|
||||||
#include "format/KdbxXmlReader.h"
|
#include "format/KdbxXmlReader.h"
|
||||||
#include "format/KeePass2.h"
|
#include "format/KeePass2.h"
|
||||||
|
#include "keys/drivers/YubiKey.h"
|
||||||
|
|
||||||
#include "cli/Add.h"
|
#include "cli/Add.h"
|
||||||
#include "cli/AddGroup.h"
|
#include "cli/AddGroup.h"
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
#include "core/EntrySearcher.h"
|
#include "core/EntrySearcher.h"
|
||||||
#include "fdosecrets/GcryptMPI.h"
|
#include "fdosecrets/GcryptMPI.h"
|
||||||
#include "fdosecrets/objects/SessionCipher.h"
|
|
||||||
#include "fdosecrets/objects/Collection.h"
|
#include "fdosecrets/objects/Collection.h"
|
||||||
#include "fdosecrets/objects/Item.h"
|
#include "fdosecrets/objects/Item.h"
|
||||||
|
#include "fdosecrets/objects/SessionCipher.h"
|
||||||
|
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ void TestFdoSecrets::testDhIetf1024Sha256Aes128CbcPkcs7()
|
|||||||
|
|
||||||
void TestFdoSecrets::testCrazyAttributeKey()
|
void TestFdoSecrets::testCrazyAttributeKey()
|
||||||
{
|
{
|
||||||
using FdoSecrets::Item;
|
|
||||||
using FdoSecrets::Collection;
|
using FdoSecrets::Collection;
|
||||||
|
using FdoSecrets::Item;
|
||||||
|
|
||||||
const QScopedPointer<Group> root(new Group());
|
const QScopedPointer<Group> root(new Group());
|
||||||
const QScopedPointer<Entry> e1(new Entry());
|
const QScopedPointer<Entry> e1(new Entry());
|
||||||
|
@ -71,7 +71,7 @@ bool TemporaryFile::copyFromFile(const QString& otherFileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
while(!(data = otherFile.read(1024)).isEmpty()) {
|
while (!(data = otherFile.read(1024)).isEmpty()) {
|
||||||
write(data);
|
write(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user