mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 07:49:50 -05:00
Fix code formatting with new clang-format version
This commit is contained in:
parent
afe634d4f2
commit
e48ef80e9c
@ -50,14 +50,11 @@ AutoTypePlatformX11::AutoTypePlatformX11()
|
|||||||
m_atomTransientFor = XInternAtom(m_dpy, "WM_TRANSIENT_FOR", True);
|
m_atomTransientFor = XInternAtom(m_dpy, "WM_TRANSIENT_FOR", True);
|
||||||
m_atomWindow = XInternAtom(m_dpy, "WINDOW", True);
|
m_atomWindow = XInternAtom(m_dpy, "WINDOW", True);
|
||||||
|
|
||||||
m_classBlacklist << "desktop_window"
|
m_classBlacklist << "desktop_window" << "gnome-panel"; // Gnome
|
||||||
<< "gnome-panel"; // Gnome
|
m_classBlacklist << "kdesktop" << "kicker"; // KDE 3
|
||||||
m_classBlacklist << "kdesktop"
|
|
||||||
<< "kicker"; // KDE 3
|
|
||||||
m_classBlacklist << "Plasma"; // KDE 4
|
m_classBlacklist << "Plasma"; // KDE 4
|
||||||
m_classBlacklist << "plasmashell"; // KDE 5
|
m_classBlacklist << "plasmashell"; // KDE 5
|
||||||
m_classBlacklist << "xfdesktop"
|
m_classBlacklist << "xfdesktop" << "xfce4-panel"; // Xfce 4
|
||||||
<< "xfce4-panel"; // Xfce 4
|
|
||||||
|
|
||||||
m_xkb = nullptr;
|
m_xkb = nullptr;
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Add::UsernameOption = QCommandLineOption(QStringList() << "u"
|
const QCommandLineOption Add::UsernameOption = QCommandLineOption(QStringList() << "u" << "username",
|
||||||
<< "username",
|
|
||||||
QObject::tr("Username for the entry."),
|
QObject::tr("Username for the entry."),
|
||||||
QObject::tr("username"));
|
QObject::tr("username"));
|
||||||
|
|
||||||
@ -37,13 +36,10 @@ const QCommandLineOption Add::NotesOption =
|
|||||||
QCommandLineOption(QStringList() << "notes", QObject::tr("Notes for the entry."), QObject::tr("Notes"));
|
QCommandLineOption(QStringList() << "notes", QObject::tr("Notes for the entry."), QObject::tr("Notes"));
|
||||||
|
|
||||||
const QCommandLineOption Add::PasswordPromptOption =
|
const QCommandLineOption Add::PasswordPromptOption =
|
||||||
QCommandLineOption(QStringList() << "p"
|
QCommandLineOption(QStringList() << "p" << "password-prompt", QObject::tr("Prompt for the entry's password."));
|
||||||
<< "password-prompt",
|
|
||||||
QObject::tr("Prompt for the entry's password."));
|
|
||||||
|
|
||||||
const QCommandLineOption Add::GenerateOption = QCommandLineOption(QStringList() << "g"
|
const QCommandLineOption Add::GenerateOption =
|
||||||
<< "generate",
|
QCommandLineOption(QStringList() << "g" << "generate", QObject::tr("Generate a password for the entry."));
|
||||||
QObject::tr("Generate a password for the entry."));
|
|
||||||
|
|
||||||
Add::Add()
|
Add::Add()
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
const QCommandLineOption AttachmentImport::ForceOption =
|
const QCommandLineOption AttachmentImport::ForceOption =
|
||||||
QCommandLineOption(QStringList() << "f"
|
QCommandLineOption(QStringList() << "f" << "force", QObject::tr("Overwrite existing attachments."));
|
||||||
<< "force",
|
|
||||||
QObject::tr("Overwrite existing attachments."));
|
|
||||||
|
|
||||||
AttachmentImport::AttachmentImport()
|
AttachmentImport::AttachmentImport()
|
||||||
{
|
{
|
||||||
|
@ -27,21 +27,18 @@
|
|||||||
#define CLI_DEFAULT_CLIP_TIMEOUT 10
|
#define CLI_DEFAULT_CLIP_TIMEOUT 10
|
||||||
|
|
||||||
const QCommandLineOption Clip::AttributeOption = QCommandLineOption(
|
const QCommandLineOption Clip::AttributeOption = QCommandLineOption(
|
||||||
QStringList() << "a"
|
QStringList() << "a" << "attribute",
|
||||||
<< "attribute",
|
|
||||||
QObject::tr("Copy the given attribute to the clipboard. Defaults to \"password\" if not specified.",
|
QObject::tr("Copy the given attribute to the clipboard. Defaults to \"password\" if not specified.",
|
||||||
"Don't translate \"password\", it refers to the attribute."),
|
"Don't translate \"password\", it refers to the attribute."),
|
||||||
"attr",
|
"attr",
|
||||||
"password");
|
"password");
|
||||||
|
|
||||||
const QCommandLineOption Clip::TotpOption =
|
const QCommandLineOption Clip::TotpOption =
|
||||||
QCommandLineOption(QStringList() << "t"
|
QCommandLineOption(QStringList() << "t" << "totp",
|
||||||
<< "totp",
|
|
||||||
QObject::tr("Copy the current TOTP to the clipboard (equivalent to \"-a totp\")."));
|
QObject::tr("Copy the current TOTP to the clipboard (equivalent to \"-a totp\")."));
|
||||||
|
|
||||||
const QCommandLineOption Clip::BestMatchOption =
|
const QCommandLineOption Clip::BestMatchOption =
|
||||||
QCommandLineOption(QStringList() << "b"
|
QCommandLineOption(QStringList() << "b" << "best-match",
|
||||||
<< "best-match",
|
|
||||||
QObject::tr("Must match only one entry, otherwise a list of possible matches is shown."));
|
QObject::tr("Must match only one entry, otherwise a list of possible matches is shown."));
|
||||||
|
|
||||||
Clip::Clip()
|
Clip::Clip()
|
||||||
|
@ -56,12 +56,10 @@ const QCommandLineOption Command::HelpOption = QCommandLineOption(QStringList()
|
|||||||
QObject::tr("Display this help."));
|
QObject::tr("Display this help."));
|
||||||
|
|
||||||
const QCommandLineOption Command::QuietOption =
|
const QCommandLineOption Command::QuietOption =
|
||||||
QCommandLineOption(QStringList() << "q"
|
QCommandLineOption(QStringList() << "q" << "quiet",
|
||||||
<< "quiet",
|
|
||||||
QObject::tr("Silence password prompt and other secondary outputs."));
|
QObject::tr("Silence password prompt and other secondary outputs."));
|
||||||
|
|
||||||
const QCommandLineOption Command::KeyFileOption = QCommandLineOption(QStringList() << "k"
|
const QCommandLineOption Command::KeyFileOption = QCommandLineOption(QStringList() << "k" << "key-file",
|
||||||
<< "key-file",
|
|
||||||
QObject::tr("Key file of the database."),
|
QObject::tr("Key file of the database."),
|
||||||
QObject::tr("path"));
|
QObject::tr("path"));
|
||||||
|
|
||||||
@ -69,8 +67,7 @@ const QCommandLineOption Command::NoPasswordOption =
|
|||||||
QCommandLineOption(QStringList() << "no-password", QObject::tr("Deactivate password key for the database."));
|
QCommandLineOption(QStringList() << "no-password", QObject::tr("Deactivate password key for the database."));
|
||||||
|
|
||||||
const QCommandLineOption Command::YubiKeyOption =
|
const QCommandLineOption Command::YubiKeyOption =
|
||||||
QCommandLineOption(QStringList() << "y"
|
QCommandLineOption(QStringList() << "y" << "yubikey",
|
||||||
<< "yubikey",
|
|
||||||
QObject::tr("Yubikey slot and optional serial used to access the database (e.g., 1:7370001)."),
|
QObject::tr("Yubikey slot and optional serial used to access the database (e.g., 1:7370001)."),
|
||||||
QObject::tr("slot[:serial]"));
|
QObject::tr("slot[:serial]"));
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
const QCommandLineOption DatabaseCreate::DecryptionTimeOption =
|
const QCommandLineOption DatabaseCreate::DecryptionTimeOption =
|
||||||
QCommandLineOption(QStringList() << "t"
|
QCommandLineOption(QStringList() << "t" << "decryption-time",
|
||||||
<< "decryption-time",
|
|
||||||
QObject::tr("Target decryption time in MS for the database."),
|
QObject::tr("Target decryption time in MS for the database."),
|
||||||
QObject::tr("time"));
|
QObject::tr("time"));
|
||||||
|
|
||||||
@ -41,9 +40,7 @@ const QCommandLineOption DatabaseCreate::SetKeyFileOption =
|
|||||||
QObject::tr("path"));
|
QObject::tr("path"));
|
||||||
|
|
||||||
const QCommandLineOption DatabaseCreate::SetPasswordOption =
|
const QCommandLineOption DatabaseCreate::SetPasswordOption =
|
||||||
QCommandLineOption(QStringList() << "p"
|
QCommandLineOption(QStringList() << "p" << "set-password", QObject::tr("Set a password for the database."));
|
||||||
<< "set-password",
|
|
||||||
QObject::tr("Set a password for the database."));
|
|
||||||
|
|
||||||
DatabaseCreate::DatabaseCreate()
|
DatabaseCreate::DatabaseCreate()
|
||||||
{
|
{
|
||||||
|
@ -24,14 +24,12 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Diceware::WordCountOption =
|
const QCommandLineOption Diceware::WordCountOption =
|
||||||
QCommandLineOption(QStringList() << "W"
|
QCommandLineOption(QStringList() << "W" << "words",
|
||||||
<< "words",
|
|
||||||
QObject::tr("Word count for the diceware passphrase."),
|
QObject::tr("Word count for the diceware passphrase."),
|
||||||
QObject::tr("count", "CLI parameter"));
|
QObject::tr("count", "CLI parameter"));
|
||||||
|
|
||||||
const QCommandLineOption Diceware::WordListOption =
|
const QCommandLineOption Diceware::WordListOption =
|
||||||
QCommandLineOption(QStringList() << "w"
|
QCommandLineOption(QStringList() << "w" << "word-list",
|
||||||
<< "word-list",
|
|
||||||
QObject::tr("Wordlist for the diceware generator.\n[Default: EFF English]"),
|
QObject::tr("Wordlist for the diceware generator.\n[Default: EFF English]"),
|
||||||
QObject::tr("path"));
|
QObject::tr("path"));
|
||||||
|
|
||||||
|
@ -26,10 +26,8 @@
|
|||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Edit::TitleOption = QCommandLineOption(QStringList() << "t"
|
const QCommandLineOption Edit::TitleOption =
|
||||||
<< "title",
|
QCommandLineOption(QStringList() << "t" << "title", QObject::tr("Title for the entry."), QObject::tr("title"));
|
||||||
QObject::tr("Title for the entry."),
|
|
||||||
QObject::tr("title"));
|
|
||||||
|
|
||||||
Edit::Edit()
|
Edit::Edit()
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,7 @@
|
|||||||
#include <zxcvbn.h>
|
#include <zxcvbn.h>
|
||||||
|
|
||||||
const QCommandLineOption Estimate::AdvancedOption =
|
const QCommandLineOption Estimate::AdvancedOption =
|
||||||
QCommandLineOption(QStringList() << "a"
|
QCommandLineOption(QStringList() << "a" << "advanced", QObject::tr("Perform advanced analysis on the password."));
|
||||||
<< "advanced",
|
|
||||||
QObject::tr("Perform advanced analysis on the password."));
|
|
||||||
|
|
||||||
Estimate::Estimate()
|
Estimate::Estimate()
|
||||||
{
|
{
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Export::FormatOption = QCommandLineOption(
|
const QCommandLineOption Export::FormatOption = QCommandLineOption(
|
||||||
QStringList() << "f"
|
QStringList() << "f" << "format",
|
||||||
<< "format",
|
|
||||||
QObject::tr("Format to use when exporting. Available choices are 'xml' or 'csv'. Defaults to 'xml'."),
|
QObject::tr("Format to use when exporting. Available choices are 'xml' or 'csv'. Defaults to 'xml'."),
|
||||||
QStringLiteral("xml|csv"));
|
QStringLiteral("xml|csv"));
|
||||||
|
|
||||||
|
@ -24,41 +24,30 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Generate::PasswordLengthOption =
|
const QCommandLineOption Generate::PasswordLengthOption =
|
||||||
QCommandLineOption(QStringList() << "L"
|
QCommandLineOption(QStringList() << "L" << "length",
|
||||||
<< "length",
|
|
||||||
QObject::tr("Length of the generated password"),
|
QObject::tr("Length of the generated password"),
|
||||||
QObject::tr("length"));
|
QObject::tr("length"));
|
||||||
|
|
||||||
const QCommandLineOption Generate::LowerCaseOption = QCommandLineOption(QStringList() << "l"
|
const QCommandLineOption Generate::LowerCaseOption =
|
||||||
<< "lower",
|
QCommandLineOption(QStringList() << "l" << "lower", QObject::tr("Use lowercase characters"));
|
||||||
QObject::tr("Use lowercase characters"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::UpperCaseOption = QCommandLineOption(QStringList() << "U"
|
const QCommandLineOption Generate::UpperCaseOption =
|
||||||
<< "upper",
|
QCommandLineOption(QStringList() << "U" << "upper", QObject::tr("Use uppercase characters"));
|
||||||
QObject::tr("Use uppercase characters"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::NumbersOption = QCommandLineOption(QStringList() << "n"
|
const QCommandLineOption Generate::NumbersOption =
|
||||||
<< "numeric",
|
QCommandLineOption(QStringList() << "n" << "numeric", QObject::tr("Use numbers"));
|
||||||
QObject::tr("Use numbers"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::SpecialCharsOption = QCommandLineOption(QStringList() << "s"
|
const QCommandLineOption Generate::SpecialCharsOption =
|
||||||
<< "special",
|
QCommandLineOption(QStringList() << "s" << "special", QObject::tr("Use special characters"));
|
||||||
QObject::tr("Use special characters"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::ExtendedAsciiOption = QCommandLineOption(QStringList() << "e"
|
const QCommandLineOption Generate::ExtendedAsciiOption =
|
||||||
<< "extended",
|
QCommandLineOption(QStringList() << "e" << "extended", QObject::tr("Use extended ASCII"));
|
||||||
QObject::tr("Use extended ASCII"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::ExcludeCharsOption = QCommandLineOption(QStringList() << "x"
|
const QCommandLineOption Generate::ExcludeCharsOption =
|
||||||
<< "exclude",
|
QCommandLineOption(QStringList() << "x" << "exclude", QObject::tr("Exclude character set"), QObject::tr("chars"));
|
||||||
QObject::tr("Exclude character set"),
|
|
||||||
QObject::tr("chars"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::CustomCharacterSetOption =
|
const QCommandLineOption Generate::CustomCharacterSetOption =
|
||||||
QCommandLineOption(QStringList() << "c"
|
QCommandLineOption(QStringList() << "c" << "custom", QObject::tr("Use custom character set"), QObject::tr("chars"));
|
||||||
<< "custom",
|
|
||||||
QObject::tr("Use custom character set"),
|
|
||||||
QObject::tr("chars"));
|
|
||||||
|
|
||||||
const QCommandLineOption Generate::ExcludeSimilarCharsOption =
|
const QCommandLineOption Generate::ExcludeSimilarCharsOption =
|
||||||
QCommandLineOption(QStringList() << "exclude-similar", QObject::tr("Exclude similar looking characters"));
|
QCommandLineOption(QStringList() << "exclude-similar", QObject::tr("Exclude similar looking characters"));
|
||||||
|
@ -24,13 +24,10 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption List::RecursiveOption =
|
const QCommandLineOption List::RecursiveOption =
|
||||||
QCommandLineOption(QStringList() << "R"
|
QCommandLineOption(QStringList() << "R" << "recursive", QObject::tr("Recursively list the elements of the group."));
|
||||||
<< "recursive",
|
|
||||||
QObject::tr("Recursively list the elements of the group."));
|
|
||||||
|
|
||||||
const QCommandLineOption List::FlattenOption = QCommandLineOption(QStringList() << "f"
|
const QCommandLineOption List::FlattenOption =
|
||||||
<< "flatten",
|
QCommandLineOption(QStringList() << "f" << "flatten", QObject::tr("Flattens the output to single lines."));
|
||||||
QObject::tr("Flattens the output to single lines."));
|
|
||||||
|
|
||||||
List::List()
|
List::List()
|
||||||
{
|
{
|
||||||
|
@ -24,8 +24,7 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Merge::SameCredentialsOption =
|
const QCommandLineOption Merge::SameCredentialsOption =
|
||||||
QCommandLineOption(QStringList() << "s"
|
QCommandLineOption(QStringList() << "s" << "same-credentials",
|
||||||
<< "same-credentials",
|
|
||||||
QObject::tr("Use the same credentials for both database files."));
|
QObject::tr("Use the same credentials for both database files."));
|
||||||
|
|
||||||
const QCommandLineOption Merge::KeyFileFromOption =
|
const QCommandLineOption Merge::KeyFileFromOption =
|
||||||
|
@ -23,13 +23,11 @@
|
|||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
const QCommandLineOption Show::TotpOption = QCommandLineOption(QStringList() << "t"
|
const QCommandLineOption Show::TotpOption =
|
||||||
<< "totp",
|
QCommandLineOption(QStringList() << "t" << "totp", QObject::tr("Show the entry's current TOTP."));
|
||||||
QObject::tr("Show the entry's current TOTP."));
|
|
||||||
|
|
||||||
const QCommandLineOption Show::ProtectedAttributesOption =
|
const QCommandLineOption Show::ProtectedAttributesOption =
|
||||||
QCommandLineOption(QStringList() << "s"
|
QCommandLineOption(QStringList() << "s" << "show-protected",
|
||||||
<< "show-protected",
|
|
||||||
QObject::tr("Show the protected attributes in clear text."));
|
QObject::tr("Show the protected attributes in clear text."));
|
||||||
|
|
||||||
const QCommandLineOption Show::AllAttributesOption =
|
const QCommandLineOption Show::AllAttributesOption =
|
||||||
@ -39,8 +37,7 @@ const QCommandLineOption Show::AttachmentsOption =
|
|||||||
QCommandLineOption(QStringList() << "show-attachments", QObject::tr("Show the attachments of the entry."));
|
QCommandLineOption(QStringList() << "show-attachments", QObject::tr("Show the attachments of the entry."));
|
||||||
|
|
||||||
const QCommandLineOption Show::AttributesOption = QCommandLineOption(
|
const QCommandLineOption Show::AttributesOption = QCommandLineOption(
|
||||||
QStringList() << "a"
|
QStringList() << "a" << "attributes",
|
||||||
<< "attributes",
|
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"Names of the attributes to show. "
|
"Names of the attributes to show. "
|
||||||
"This option can be specified more than once, with each attribute shown one-per-line in the given order. "
|
"This option can be specified more than once, with each attribute shown one-per-line in the given order. "
|
||||||
|
@ -124,10 +124,7 @@ namespace Tools
|
|||||||
constexpr auto kibibyte = 1024;
|
constexpr auto kibibyte = 1024;
|
||||||
double size = bytes;
|
double size = bytes;
|
||||||
|
|
||||||
QStringList units = QStringList() << "B"
|
QStringList units = QStringList() << "B" << "KiB" << "MiB" << "GiB";
|
||||||
<< "KiB"
|
|
||||||
<< "MiB"
|
|
||||||
<< "GiB";
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int maxI = units.size() - 1;
|
int maxI = units.size() - 1;
|
||||||
|
|
||||||
|
@ -77,12 +77,7 @@ CsvImportWidget::CsvImportWidget(QWidget* parent)
|
|||||||
<< QObject::tr("URL") << QObject::tr("Notes") << QObject::tr("TOTP") << QObject::tr("Icon")
|
<< QObject::tr("URL") << QObject::tr("Notes") << QObject::tr("TOTP") << QObject::tr("Icon")
|
||||||
<< QObject::tr("Last Modified") << QObject::tr("Created");
|
<< QObject::tr("Last Modified") << QObject::tr("Created");
|
||||||
|
|
||||||
m_fieldSeparatorList << ","
|
m_fieldSeparatorList << "," << ";" << "-" << ":" << "." << "\t";
|
||||||
<< ";"
|
|
||||||
<< "-"
|
|
||||||
<< ":"
|
|
||||||
<< "."
|
|
||||||
<< "\t";
|
|
||||||
|
|
||||||
m_combos << m_ui->groupCombo << m_ui->titleCombo << m_ui->usernameCombo << m_ui->passwordCombo << m_ui->urlCombo
|
m_combos << m_ui->groupCombo << m_ui->titleCombo << m_ui->usernameCombo << m_ui->passwordCombo << m_ui->urlCombo
|
||||||
<< m_ui->notesCombo << m_ui->totpCombo << m_ui->iconCombo << m_ui->lastModifiedCombo << m_ui->createdCombo;
|
<< m_ui->notesCombo << m_ui->totpCombo << m_ui->iconCombo << m_ui->lastModifiedCombo << m_ui->createdCombo;
|
||||||
|
@ -68,13 +68,9 @@ void PasskeyImporter::importSelectedFile(QFile& file, QSharedPointer<Database>&
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto privateKey = passkeyObject["privateKey"].toString();
|
const auto privateKey = passkeyObject["privateKey"].toString();
|
||||||
const auto missingKeys = Tools::getMissingValuesFromList<QString>(passkeyObject.keys(),
|
const auto missingKeys = Tools::getMissingValuesFromList<QString>(
|
||||||
QStringList() << "relyingParty"
|
passkeyObject.keys(),
|
||||||
<< "url"
|
QStringList() << "relyingParty" << "url" << "username" << "credentialId" << "userHandle" << "privateKey");
|
||||||
<< "username"
|
|
||||||
<< "credentialId"
|
|
||||||
<< "userHandle"
|
|
||||||
<< "privateKey");
|
|
||||||
if (!missingKeys.isEmpty()) {
|
if (!missingKeys.isEmpty()) {
|
||||||
MessageBox::information(m_parent,
|
MessageBox::information(m_parent,
|
||||||
tr("Cannot import passkey"),
|
tr("Cannot import passkey"),
|
||||||
|
@ -170,26 +170,22 @@ void TestBrowser::testSortPriority_data()
|
|||||||
QTest::newRow("Exact Match") << siteUrl << siteUrl << siteUrl << 100;
|
QTest::newRow("Exact Match") << siteUrl << siteUrl << siteUrl << 100;
|
||||||
QTest::newRow("Exact Match (site)") << siteUrl << siteUrl << formUrl << 100;
|
QTest::newRow("Exact Match (site)") << siteUrl << siteUrl << formUrl << 100;
|
||||||
QTest::newRow("Exact Match (form)") << siteUrl << "https://github.net" << siteUrl << 100;
|
QTest::newRow("Exact Match (form)") << siteUrl << "https://github.net" << siteUrl << 100;
|
||||||
QTest::newRow("Exact Match No Trailing Slash") << "https://github.com"
|
QTest::newRow("Exact Match No Trailing Slash") << "https://github.com" << "https://github.com/" << formUrl << 100;
|
||||||
<< "https://github.com/" << formUrl << 100;
|
|
||||||
QTest::newRow("Exact Match No Scheme") << "github.com/login" << siteUrl << formUrl << 100;
|
QTest::newRow("Exact Match No Scheme") << "github.com/login" << siteUrl << formUrl << 100;
|
||||||
QTest::newRow("Exact Match with Query") << "https://github.com/login?test=test#fragment"
|
QTest::newRow("Exact Match with Query")
|
||||||
<< "https://github.com/login?test=test" << formUrl << 100;
|
<< "https://github.com/login?test=test#fragment" << "https://github.com/login?test=test" << formUrl << 100;
|
||||||
|
|
||||||
QTest::newRow("Site Query Mismatch") << siteUrl << siteUrl + "?test=test" << formUrl << 90;
|
QTest::newRow("Site Query Mismatch") << siteUrl << siteUrl + "?test=test" << formUrl << 90;
|
||||||
|
|
||||||
QTest::newRow("Path Mismatch (site)") << "https://github.com/" << siteUrl << formUrl << 85;
|
QTest::newRow("Path Mismatch (site)") << "https://github.com/" << siteUrl << formUrl << 85;
|
||||||
QTest::newRow("Path Mismatch (site) No Scheme") << "github.com" << siteUrl << formUrl << 85;
|
QTest::newRow("Path Mismatch (site) No Scheme") << "github.com" << siteUrl << formUrl << 85;
|
||||||
QTest::newRow("Path Mismatch (form)") << "https://github.com/"
|
QTest::newRow("Path Mismatch (form)") << "https://github.com/" << "https://github.net" << formUrl << 85;
|
||||||
<< "https://github.net" << formUrl << 85;
|
|
||||||
QTest::newRow("Path Mismatch (diff parent)") << "https://github.com/keepassxreboot" << siteUrl << formUrl << 80;
|
QTest::newRow("Path Mismatch (diff parent)") << "https://github.com/keepassxreboot" << siteUrl << formUrl << 80;
|
||||||
QTest::newRow("Path Mismatch (diff parent, form)") << "https://github.com/keepassxreboot"
|
QTest::newRow("Path Mismatch (diff parent, form)")
|
||||||
<< "https://github.net" << formUrl << 70;
|
<< "https://github.com/keepassxreboot" << "https://github.net" << formUrl << 70;
|
||||||
|
|
||||||
QTest::newRow("Subdomain Mismatch (site)") << siteUrl << "https://sub.github.com/"
|
QTest::newRow("Subdomain Mismatch (site)") << siteUrl << "https://sub.github.com/" << "https://github.net/" << 60;
|
||||||
<< "https://github.net/" << 60;
|
QTest::newRow("Subdomain Mismatch (form)") << siteUrl << "https://github.net/" << "https://sub.github.com/" << 50;
|
||||||
QTest::newRow("Subdomain Mismatch (form)") << siteUrl << "https://github.net/"
|
|
||||||
<< "https://sub.github.com/" << 50;
|
|
||||||
|
|
||||||
QTest::newRow("Scheme Mismatch") << "http://github.com" << siteUrl << formUrl << 0;
|
QTest::newRow("Scheme Mismatch") << "http://github.com" << siteUrl << formUrl << 0;
|
||||||
QTest::newRow("Scheme Mismatch w/path") << "http://github.com/login" << siteUrl << formUrl << 0;
|
QTest::newRow("Scheme Mismatch w/path") << "http://github.com/login" << siteUrl << formUrl << 0;
|
||||||
|
@ -74,8 +74,7 @@ void TestCsvParser::testBackslashSyntax()
|
|||||||
QTextStream out(file.data());
|
QTextStream out(file.data());
|
||||||
// attended result: one"\t\"wo
|
// attended result: one"\t\"wo
|
||||||
out << "Xone\\\"\\\\t\\\\\\\"w\noX\n"
|
out << "Xone\\\"\\\\t\\\\\\\"w\noX\n"
|
||||||
<< "X13X,X2\\X,X,\"\"3\"X\r"
|
<< "X13X,X2\\X,X,\"\"3\"X\r" << "3,X\"4\"X,,\n"
|
||||||
<< "3,X\"4\"X,,\n"
|
|
||||||
<< "XX\n"
|
<< "XX\n"
|
||||||
<< "\\";
|
<< "\\";
|
||||||
QVERIFY(parser->parse(file.data()));
|
QVERIFY(parser->parse(file.data()));
|
||||||
@ -195,8 +194,7 @@ void TestCsvParser::testComments()
|
|||||||
QTextStream out(file.data());
|
QTextStream out(file.data());
|
||||||
out << " #one\n"
|
out << " #one\n"
|
||||||
<< " \t # two, three \r\n"
|
<< " \t # two, three \r\n"
|
||||||
<< " #, sing\t with\r"
|
<< " #, sing\t with\r" << " #\t me!\n"
|
||||||
<< " #\t me!\n"
|
|
||||||
<< "useful,text #1!";
|
<< "useful,text #1!";
|
||||||
QVERIFY(parser->parse(file.data()));
|
QVERIFY(parser->parse(file.data()));
|
||||||
t = parser->getCsvTable();
|
t = parser->getCsvTable();
|
||||||
@ -311,8 +309,7 @@ void TestCsvParser::testQualifier()
|
|||||||
{
|
{
|
||||||
parser->setTextQualifier(QChar('X'));
|
parser->setTextQualifier(QChar('X'));
|
||||||
QTextStream out(file.data());
|
QTextStream out(file.data());
|
||||||
out << "X1X,X2XX,X,\"\"3\"\"\"X\r"
|
out << "X1X,X2XX,X,\"\"3\"\"\"X\r" << "3,X\"4\"X,,\n";
|
||||||
<< "3,X\"4\"X,,\n";
|
|
||||||
QVERIFY(parser->parse(file.data()));
|
QVERIFY(parser->parse(file.data()));
|
||||||
t = parser->getCsvTable();
|
t = parser->getCsvTable();
|
||||||
QVERIFY(t.size() == 2);
|
QVERIFY(t.size() == 2);
|
||||||
|
@ -42,8 +42,7 @@ void TestSSHAgent::initTestCase()
|
|||||||
QVERIFY(m_agentSocketFile.remove());
|
QVERIFY(m_agentSocketFile.remove());
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << "-D"
|
arguments << "-D" << "-a" << m_agentSocketFileName;
|
||||||
<< "-a" << m_agentSocketFileName;
|
|
||||||
|
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
|
@ -117,12 +117,9 @@ void TestSharing::testReferenceSerialization_data()
|
|||||||
QTest::addColumn<QString>("path");
|
QTest::addColumn<QString>("path");
|
||||||
QTest::addColumn<QUuid>("uuid");
|
QTest::addColumn<QUuid>("uuid");
|
||||||
QTest::addColumn<int>("type");
|
QTest::addColumn<int>("type");
|
||||||
QTest::newRow("1") << "Password"
|
QTest::newRow("1") << "Password" << "/some/path" << QUuid::createUuid() << int(KeeShareSettings::Inactive);
|
||||||
<< "/some/path" << QUuid::createUuid() << int(KeeShareSettings::Inactive);
|
QTest::newRow("2") << "" << "" << QUuid() << int(KeeShareSettings::SynchronizeWith);
|
||||||
QTest::newRow("2") << ""
|
QTest::newRow("3") << "" << "/some/path" << QUuid() << int(KeeShareSettings::ExportTo);
|
||||||
<< "" << QUuid() << int(KeeShareSettings::SynchronizeWith);
|
|
||||||
QTest::newRow("3") << ""
|
|
||||||
<< "/some/path" << QUuid() << int(KeeShareSettings::ExportTo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestSharing::testSettingsSerialization()
|
void TestSharing::testSettingsSerialization()
|
||||||
|
@ -161,13 +161,11 @@ void TestTools::testBackupFilePatternSubstitution_data()
|
|||||||
QTest::newRow("{DB_FILENAME} substitution")
|
QTest::newRow("{DB_FILENAME} substitution")
|
||||||
<< "some {DB_FILENAME} thing" << DEFAULT_DB_FILE_PATH
|
<< "some {DB_FILENAME} thing" << DEFAULT_DB_FILE_PATH
|
||||||
<< QStringLiteral("some ") + DEFAULT_DB_FILE_NAME + QStringLiteral(" thing");
|
<< QStringLiteral("some ") + DEFAULT_DB_FILE_NAME + QStringLiteral(" thing");
|
||||||
QTest::newRow("{DB_FILENAME} substitution with multiple extensions") << "some {DB_FILENAME} thing"
|
QTest::newRow("{DB_FILENAME} substitution with multiple extensions")
|
||||||
<< "/tmp/KeePassXC.kdbx.ext"
|
<< "some {DB_FILENAME} thing" << "/tmp/KeePassXC.kdbx.ext" << "some KeePassXC.kdbx thing";
|
||||||
<< "some KeePassXC.kdbx thing";
|
|
||||||
// Not relevant right now, added test anyway
|
// Not relevant right now, added test anyway
|
||||||
QTest::newRow("There should be no substitution loops") << "{DB_FILENAME}"
|
QTest::newRow("There should be no substitution loops")
|
||||||
<< "{TIME:'{DB_FILENAME}'}.ext"
|
<< "{DB_FILENAME}" << "{TIME:'{DB_FILENAME}'}.ext" << "{TIME:'{DB_FILENAME}'}";
|
||||||
<< "{TIME:'{DB_FILENAME}'}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestTools::testBackupFilePatternSubstitution()
|
void TestTools::testBackupFilePatternSubstitution()
|
||||||
@ -193,8 +191,8 @@ void TestTools::testEscapeRegex_data()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTest::newRow("Regular characters should not be escaped") << all_regular_characters << all_regular_characters;
|
QTest::newRow("Regular characters should not be escaped") << all_regular_characters << all_regular_characters;
|
||||||
QTest::newRow("Special characters should be escaped") << R"(.^$*+-?()[]{}|\)"
|
QTest::newRow("Special characters should be escaped")
|
||||||
<< R"(\.\^\$\*\+\-\?\(\)\[\]\{\}\|\\)";
|
<< R"(.^$*+-?()[]{}|\)" << R"(\.\^\$\*\+\-\?\(\)\[\]\{\}\|\\)";
|
||||||
QTest::newRow("Null character") << QString::fromLatin1("ab\0c", 4) << "ab\\0c";
|
QTest::newRow("Null character") << QString::fromLatin1("ab\0c", 4) << "ab\\0c";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,23 +254,17 @@ void TestTools::testConvertToRegex_data()
|
|||||||
|
|
||||||
void TestTools::testArrayContainsValues()
|
void TestTools::testArrayContainsValues()
|
||||||
{
|
{
|
||||||
const auto values = QStringList() << "first"
|
const auto values = QStringList() << "first" << "second" << "third";
|
||||||
<< "second"
|
|
||||||
<< "third";
|
|
||||||
|
|
||||||
// One missing
|
// One missing
|
||||||
const auto result1 = Tools::getMissingValuesFromList<QString>(values,
|
const auto result1 =
|
||||||
QStringList() << "first"
|
Tools::getMissingValuesFromList<QString>(values, QStringList() << "first" << "second" << "none");
|
||||||
<< "second"
|
|
||||||
<< "none");
|
|
||||||
QCOMPARE(result1.length(), 1);
|
QCOMPARE(result1.length(), 1);
|
||||||
QCOMPARE(result1.first(), QString("none"));
|
QCOMPARE(result1.first(), QString("none"));
|
||||||
|
|
||||||
// All found
|
// All found
|
||||||
const auto result2 = Tools::getMissingValuesFromList<QString>(values,
|
const auto result2 =
|
||||||
QStringList() << "first"
|
Tools::getMissingValuesFromList<QString>(values, QStringList() << "first" << "second" << "third");
|
||||||
<< "second"
|
|
||||||
<< "third");
|
|
||||||
QCOMPARE(result2.length(), 0);
|
QCOMPARE(result2.length(), 0);
|
||||||
|
|
||||||
// None are found
|
// None are found
|
||||||
|
@ -801,32 +801,23 @@ void TestGui::testPasswordEntryEntropy_data()
|
|||||||
QTest::addColumn<QString>("password");
|
QTest::addColumn<QString>("password");
|
||||||
QTest::addColumn<QString>("expectedStrengthLabel");
|
QTest::addColumn<QString>("expectedStrengthLabel");
|
||||||
|
|
||||||
QTest::newRow("Empty password") << ""
|
QTest::newRow("Empty password") << "" << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("Well-known password") << "hello"
|
QTest::newRow("Well-known password") << "hello" << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("Password composed of well-known words.") << "helloworld"
|
QTest::newRow("Password composed of well-known words.") << "helloworld" << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("Password composed of well-known words with number.") << "password1"
|
QTest::newRow("Password composed of well-known words with number.") << "password1" << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("Password out of small character space.") << "D0g.................."
|
QTest::newRow("Password out of small character space.") << "D0g.................." << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("XKCD, easy substitutions.") << "Tr0ub4dour&3"
|
QTest::newRow("XKCD, easy substitutions.") << "Tr0ub4dour&3" << "Password Quality: Poor";
|
||||||
<< "Password Quality: Poor";
|
|
||||||
|
|
||||||
QTest::newRow("XKCD, word generator.") << "correcthorsebatterystaple"
|
QTest::newRow("XKCD, word generator.") << "correcthorsebatterystaple" << "Password Quality: Weak";
|
||||||
<< "Password Quality: Weak";
|
|
||||||
|
|
||||||
QTest::newRow("Random characters, medium length.") << "YQC3kbXbjC652dTDH"
|
QTest::newRow("Random characters, medium length.") << "YQC3kbXbjC652dTDH" << "Password Quality: Good";
|
||||||
<< "Password Quality: Good";
|
|
||||||
|
|
||||||
QTest::newRow("Random characters, long.") << "Bs5ZFfthWzR8DGFEjaCM6bGqhmCT4km"
|
QTest::newRow("Random characters, long.") << "Bs5ZFfthWzR8DGFEjaCM6bGqhmCT4km" << "Password Quality: Excellent";
|
||||||
<< "Password Quality: Excellent";
|
|
||||||
|
|
||||||
QTest::newRow("Long password using Zxcvbn chunk estimation")
|
QTest::newRow("Long password using Zxcvbn chunk estimation")
|
||||||
<< "quintet-tamper-kinswoman-humility-vengeful-haven-tastiness-aspire-widget-ipad-cussed-reaffirm-ladylike-"
|
<< "quintet-tamper-kinswoman-humility-vengeful-haven-tastiness-aspire-widget-ipad-cussed-reaffirm-ladylike-"
|
||||||
@ -1544,18 +1535,14 @@ void TestGui::testSaveBackupPath_data()
|
|||||||
|
|
||||||
QTest::newRow("Absolute backup path") << tmpFile.fileName() << tmpFile.fileName();
|
QTest::newRow("Absolute backup path") << tmpFile.fileName() << tmpFile.fileName();
|
||||||
// relative paths should be resolved to database parent directory
|
// relative paths should be resolved to database parent directory
|
||||||
QTest::newRow("Relative backup path (implicit)") << "other_dir/test.old.kdbx"
|
QTest::newRow("Relative backup path (implicit)") << "other_dir/test.old.kdbx" << "other_dir/test.old.kdbx";
|
||||||
<< "other_dir/test.old.kdbx";
|
QTest::newRow("Relative backup path (explicit)") << "./other_dir2/test2.old.kdbx" << "other_dir2/test2.old.kdbx";
|
||||||
QTest::newRow("Relative backup path (explicit)") << "./other_dir2/test2.old.kdbx"
|
|
||||||
<< "other_dir2/test2.old.kdbx";
|
|
||||||
|
|
||||||
QTest::newRow("Path with placeholders") << "{DB_FILENAME}.old.kdbx"
|
QTest::newRow("Path with placeholders") << "{DB_FILENAME}.old.kdbx" << "KeePassXC.old.kdbx";
|
||||||
<< "KeePassXC.old.kdbx";
|
|
||||||
// empty path should be replaced with default pattern
|
// empty path should be replaced with default pattern
|
||||||
QTest::newRow("Empty path") << QString("") << config()->getDefault(Config::BackupFilePathPattern).toString();
|
QTest::newRow("Empty path") << QString("") << config()->getDefault(Config::BackupFilePathPattern).toString();
|
||||||
// {DB_FILENAME} should be replaced with database filename
|
// {DB_FILENAME} should be replaced with database filename
|
||||||
QTest::newRow("") << "{DB_FILENAME}_.old.kdbx"
|
QTest::newRow("") << "{DB_FILENAME}_.old.kdbx" << "{DB_FILENAME}_.old.kdbx";
|
||||||
<< "{DB_FILENAME}_.old.kdbx";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestGui::testSaveBackupPath()
|
void TestGui::testSaveBackupPath()
|
||||||
|
Loading…
Reference in New Issue
Block a user