mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Run code formatter
This commit is contained in:
parent
09181fab13
commit
1e915eef89
@ -516,7 +516,7 @@ QString BrowserAction::getErrorMessage(const int errorCode) const
|
|||||||
|
|
||||||
QString BrowserAction::getReturnValue(const BrowserService::ReturnValue returnValue) const
|
QString BrowserAction::getReturnValue(const BrowserService::ReturnValue returnValue) const
|
||||||
{
|
{
|
||||||
switch(returnValue) {
|
switch (returnValue) {
|
||||||
case BrowserService::ReturnValue::Success:
|
case BrowserService::ReturnValue::Success:
|
||||||
return QString("success");
|
return QString("success");
|
||||||
case BrowserService::ReturnValue::Error:
|
case BrowserService::ReturnValue::Error:
|
||||||
|
@ -489,8 +489,7 @@ void BrowserService::addEntry(const QString& id,
|
|||||||
config.save(entry);
|
config.save(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserService::ReturnValue
|
BrowserService::ReturnValue BrowserService::updateEntry(const QString& id,
|
||||||
BrowserService::updateEntry(const QString& id,
|
|
||||||
const QString& uuid,
|
const QString& uuid,
|
||||||
const QString& login,
|
const QString& login,
|
||||||
const QString& password,
|
const QString& password,
|
||||||
@ -877,8 +876,7 @@ Group* BrowserService::getDefaultEntryGroup(const QSharedPointer<Database>& sele
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString groupName =
|
const QString groupName = QLatin1String(KEEPASSXCBROWSER_GROUP_NAME);
|
||||||
QLatin1String(KEEPASSXCBROWSER_GROUP_NAME);
|
|
||||||
|
|
||||||
for (auto* g : rootGroup->groupsRecursive(true)) {
|
for (auto* g : rootGroup->groupsRecursive(true)) {
|
||||||
if (g->name() == groupName && !g->isRecycled()) {
|
if (g->name() == groupName && !g->isRecycled()) {
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
#include "TestBrowser.h"
|
#include "TestBrowser.h"
|
||||||
#include "TestGlobal.h"
|
#include "TestGlobal.h"
|
||||||
|
#include "browser/BrowserSettings.h"
|
||||||
#include "crypto/Crypto.h"
|
#include "crypto/Crypto.h"
|
||||||
#include "sodium/crypto_box.h"
|
#include "sodium/crypto_box.h"
|
||||||
#include "browser/BrowserSettings.h"
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(TestBrowser)
|
QTEST_GUILESS_MAIN(TestBrowser)
|
||||||
@ -40,7 +40,6 @@ void TestBrowser::initTestCase()
|
|||||||
|
|
||||||
void TestBrowser::cleanupTestCase()
|
void TestBrowser::cleanupTestCase()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -210,7 +209,7 @@ void TestBrowser::testSearchEntries()
|
|||||||
QCOMPARE(result[3]->url(), QString("http://github.com"));
|
QCOMPARE(result[3]->url(), QString("http://github.com"));
|
||||||
QCOMPARE(result[4]->url(), QString("http://github.com/login"));
|
QCOMPARE(result[4]->url(), QString("http://github.com/login"));
|
||||||
QCOMPARE(result[5]->url(), QString("github.com"));
|
QCOMPARE(result[5]->url(), QString("github.com"));
|
||||||
QCOMPARE(result[6]->url(), QString("github.com")) ;
|
QCOMPARE(result[6]->url(), QString("github.com"));
|
||||||
|
|
||||||
// With matching there should be only 5 results
|
// With matching there should be only 5 results
|
||||||
browserSettings()->setMatchUrlScheme(true);
|
browserSettings()->setMatchUrlScheme(true);
|
||||||
@ -275,7 +274,8 @@ void TestBrowser::testSortEntries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
browserSettings()->setBestMatchOnly(false);
|
browserSettings()->setBestMatchOnly(false);
|
||||||
auto result = m_browserService->sortEntries(entries, "github.com", "https://github.com/session"); // entries, host, submitUrl
|
auto result =
|
||||||
|
m_browserService->sortEntries(entries, "github.com", "https://github.com/session"); // entries, host, submitUrl
|
||||||
QCOMPARE(result.size(), 10);
|
QCOMPARE(result.size(), 10);
|
||||||
QCOMPARE(result[0]->username(), QString("User 2"));
|
QCOMPARE(result[0]->username(), QString("User 2"));
|
||||||
QCOMPARE(result[0]->url(), QString("https://github.com/"));
|
QCOMPARE(result[0]->url(), QString("https://github.com/"));
|
||||||
@ -341,4 +341,4 @@ void TestBrowser::testGetDatabaseGroups()
|
|||||||
auto lastChildren = firstOfCOS.toObject()["children"].toArray();
|
auto lastChildren = firstOfCOS.toObject()["children"].toArray();
|
||||||
auto lastChild = lastChildren.at(0);
|
auto lastChild = lastChildren.at(0);
|
||||||
QCOMPARE(lastChild.toObject()["name"].toString(), QString("group2_1_1"));
|
QCOMPARE(lastChild.toObject()["name"].toString(), QString("group2_1_1"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user