Skip to content

Commit

Permalink
Fix code formatting with new clang-format version
Browse files Browse the repository at this point in the history
  • Loading branch information
phoerious authored and droidmonkey committed Jul 28, 2024
1 parent afe634d commit e48ef80
Show file tree
Hide file tree
Showing 25 changed files with 91 additions and 178 deletions.
9 changes: 3 additions & 6 deletions src/autotype/xcb/AutoTypeXCB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ AutoTypePlatformX11::AutoTypePlatformX11()
m_atomTransientFor = XInternAtom(m_dpy, "WM_TRANSIENT_FOR", True);
m_atomWindow = XInternAtom(m_dpy, "WINDOW", True);

m_classBlacklist << "desktop_window"
<< "gnome-panel"; // Gnome
m_classBlacklist << "kdesktop"
<< "kicker"; // KDE 3
m_classBlacklist << "desktop_window" << "gnome-panel"; // Gnome
m_classBlacklist << "kdesktop" << "kicker"; // KDE 3
m_classBlacklist << "Plasma"; // KDE 4
m_classBlacklist << "plasmashell"; // KDE 5
m_classBlacklist << "xfdesktop"
<< "xfce4-panel"; // Xfce 4
m_classBlacklist << "xfdesktop" << "xfce4-panel"; // Xfce 4

m_xkb = nullptr;

Expand Down
12 changes: 4 additions & 8 deletions src/cli/Add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

#include <QCommandLineParser>

const QCommandLineOption Add::UsernameOption = QCommandLineOption(QStringList() << "u"
<< "username",
const QCommandLineOption Add::UsernameOption = QCommandLineOption(QStringList() << "u" << "username",
QObject::tr("Username for the entry."),
QObject::tr("username"));

Expand All @@ -37,13 +36,10 @@ const QCommandLineOption Add::NotesOption =
QCommandLineOption(QStringList() << "notes", QObject::tr("Notes for the entry."), QObject::tr("Notes"));

const QCommandLineOption Add::PasswordPromptOption =
QCommandLineOption(QStringList() << "p"
<< "password-prompt",
QObject::tr("Prompt for the entry's password."));
QCommandLineOption(QStringList() << "p" << "password-prompt", QObject::tr("Prompt for the entry's password."));

const QCommandLineOption Add::GenerateOption = QCommandLineOption(QStringList() << "g"
<< "generate",
QObject::tr("Generate a password for the entry."));
const QCommandLineOption Add::GenerateOption =
QCommandLineOption(QStringList() << "g" << "generate", QObject::tr("Generate a password for the entry."));

Add::Add()
{
Expand Down
4 changes: 1 addition & 3 deletions src/cli/AttachmentImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#include <QFile>

const QCommandLineOption AttachmentImport::ForceOption =
QCommandLineOption(QStringList() << "f"
<< "force",
QObject::tr("Overwrite existing attachments."));
QCommandLineOption(QStringList() << "f" << "force", QObject::tr("Overwrite existing attachments."));

AttachmentImport::AttachmentImport()
{
Expand Down
9 changes: 3 additions & 6 deletions src/cli/Clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,18 @@
#define CLI_DEFAULT_CLIP_TIMEOUT 10

const QCommandLineOption Clip::AttributeOption = QCommandLineOption(
QStringList() << "a"
<< "attribute",
QStringList() << "a" << "attribute",
QObject::tr("Copy the given attribute to the clipboard. Defaults to \"password\" if not specified.",
"Don't translate \"password\", it refers to the attribute."),
"attr",
"password");

const QCommandLineOption Clip::TotpOption =
QCommandLineOption(QStringList() << "t"
<< "totp",
QCommandLineOption(QStringList() << "t" << "totp",
QObject::tr("Copy the current TOTP to the clipboard (equivalent to \"-a totp\")."));

const QCommandLineOption Clip::BestMatchOption =
QCommandLineOption(QStringList() << "b"
<< "best-match",
QCommandLineOption(QStringList() << "b" << "best-match",
QObject::tr("Must match only one entry, otherwise a list of possible matches is shown."));

Clip::Clip()
Expand Down
9 changes: 3 additions & 6 deletions src/cli/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,18 @@ const QCommandLineOption Command::HelpOption = QCommandLineOption(QStringList()
QObject::tr("Display this help."));

const QCommandLineOption Command::QuietOption =
QCommandLineOption(QStringList() << "q"
<< "quiet",
QCommandLineOption(QStringList() << "q" << "quiet",
QObject::tr("Silence password prompt and other secondary outputs."));

const QCommandLineOption Command::KeyFileOption = QCommandLineOption(QStringList() << "k"
<< "key-file",
const QCommandLineOption Command::KeyFileOption = QCommandLineOption(QStringList() << "k" << "key-file",
QObject::tr("Key file of the database."),
QObject::tr("path"));

const QCommandLineOption Command::NoPasswordOption =
QCommandLineOption(QStringList() << "no-password", QObject::tr("Deactivate password key for the database."));

const QCommandLineOption Command::YubiKeyOption =
QCommandLineOption(QStringList() << "y"
<< "yubikey",
QCommandLineOption(QStringList() << "y" << "yubikey",
QObject::tr("Yubikey slot and optional serial used to access the database (e.g., 1:7370001)."),
QObject::tr("slot[:serial]"));

Expand Down
7 changes: 2 additions & 5 deletions src/cli/DatabaseCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <QFileInfo>

const QCommandLineOption DatabaseCreate::DecryptionTimeOption =
QCommandLineOption(QStringList() << "t"
<< "decryption-time",
QCommandLineOption(QStringList() << "t" << "decryption-time",
QObject::tr("Target decryption time in MS for the database."),
QObject::tr("time"));

Expand All @@ -41,9 +40,7 @@ const QCommandLineOption DatabaseCreate::SetKeyFileOption =
QObject::tr("path"));

const QCommandLineOption DatabaseCreate::SetPasswordOption =
QCommandLineOption(QStringList() << "p"
<< "set-password",
QObject::tr("Set a password for the database."));
QCommandLineOption(QStringList() << "p" << "set-password", QObject::tr("Set a password for the database."));

DatabaseCreate::DatabaseCreate()
{
Expand Down
6 changes: 2 additions & 4 deletions src/cli/Diceware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
#include <QCommandLineParser>

const QCommandLineOption Diceware::WordCountOption =
QCommandLineOption(QStringList() << "W"
<< "words",
QCommandLineOption(QStringList() << "W" << "words",
QObject::tr("Word count for the diceware passphrase."),
QObject::tr("count", "CLI parameter"));

const QCommandLineOption Diceware::WordListOption =
QCommandLineOption(QStringList() << "w"
<< "word-list",
QCommandLineOption(QStringList() << "w" << "word-list",
QObject::tr("Wordlist for the diceware generator.\n[Default: EFF English]"),
QObject::tr("path"));

Expand Down
6 changes: 2 additions & 4 deletions src/cli/Edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@

#include <QCommandLineParser>

const QCommandLineOption Edit::TitleOption = QCommandLineOption(QStringList() << "t"
<< "title",
QObject::tr("Title for the entry."),
QObject::tr("title"));
const QCommandLineOption Edit::TitleOption =
QCommandLineOption(QStringList() << "t" << "title", QObject::tr("Title for the entry."), QObject::tr("title"));

Edit::Edit()
{
Expand Down
4 changes: 1 addition & 3 deletions src/cli/Estimate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#include <zxcvbn.h>

const QCommandLineOption Estimate::AdvancedOption =
QCommandLineOption(QStringList() << "a"
<< "advanced",
QObject::tr("Perform advanced analysis on the password."));
QCommandLineOption(QStringList() << "a" << "advanced", QObject::tr("Perform advanced analysis on the password."));

Estimate::Estimate()
{
Expand Down
3 changes: 1 addition & 2 deletions src/cli/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <QCommandLineParser>

const QCommandLineOption Export::FormatOption = QCommandLineOption(
QStringList() << "f"
<< "format",
QStringList() << "f" << "format",
QObject::tr("Format to use when exporting. Available choices are 'xml' or 'csv'. Defaults to 'xml'."),
QStringLiteral("xml|csv"));

Expand Down
39 changes: 14 additions & 25 deletions src/cli/Generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,30 @@
#include <QCommandLineParser>

const QCommandLineOption Generate::PasswordLengthOption =
QCommandLineOption(QStringList() << "L"
<< "length",
QCommandLineOption(QStringList() << "L" << "length",
QObject::tr("Length of the generated password"),
QObject::tr("length"));

const QCommandLineOption Generate::LowerCaseOption = QCommandLineOption(QStringList() << "l"
<< "lower",
QObject::tr("Use lowercase characters"));
const QCommandLineOption Generate::LowerCaseOption =
QCommandLineOption(QStringList() << "l" << "lower", QObject::tr("Use lowercase characters"));

const QCommandLineOption Generate::UpperCaseOption = QCommandLineOption(QStringList() << "U"
<< "upper",
QObject::tr("Use uppercase characters"));
const QCommandLineOption Generate::UpperCaseOption =
QCommandLineOption(QStringList() << "U" << "upper", QObject::tr("Use uppercase characters"));

const QCommandLineOption Generate::NumbersOption = QCommandLineOption(QStringList() << "n"
<< "numeric",
QObject::tr("Use numbers"));
const QCommandLineOption Generate::NumbersOption =
QCommandLineOption(QStringList() << "n" << "numeric", QObject::tr("Use numbers"));

const QCommandLineOption Generate::SpecialCharsOption = QCommandLineOption(QStringList() << "s"
<< "special",
QObject::tr("Use special characters"));
const QCommandLineOption Generate::SpecialCharsOption =
QCommandLineOption(QStringList() << "s" << "special", QObject::tr("Use special characters"));

const QCommandLineOption Generate::ExtendedAsciiOption = QCommandLineOption(QStringList() << "e"
<< "extended",
QObject::tr("Use extended ASCII"));
const QCommandLineOption Generate::ExtendedAsciiOption =
QCommandLineOption(QStringList() << "e" << "extended", QObject::tr("Use extended ASCII"));

const QCommandLineOption Generate::ExcludeCharsOption = QCommandLineOption(QStringList() << "x"
<< "exclude",
QObject::tr("Exclude character set"),
QObject::tr("chars"));
const QCommandLineOption Generate::ExcludeCharsOption =
QCommandLineOption(QStringList() << "x" << "exclude", QObject::tr("Exclude character set"), QObject::tr("chars"));

const QCommandLineOption Generate::CustomCharacterSetOption =
QCommandLineOption(QStringList() << "c"
<< "custom",
QObject::tr("Use custom character set"),
QObject::tr("chars"));
QCommandLineOption(QStringList() << "c" << "custom", QObject::tr("Use custom character set"), QObject::tr("chars"));

const QCommandLineOption Generate::ExcludeSimilarCharsOption =
QCommandLineOption(QStringList() << "exclude-similar", QObject::tr("Exclude similar looking characters"));
Expand Down
9 changes: 3 additions & 6 deletions src/cli/List.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@
#include <QCommandLineParser>

const QCommandLineOption List::RecursiveOption =
QCommandLineOption(QStringList() << "R"
<< "recursive",
QObject::tr("Recursively list the elements of the group."));
QCommandLineOption(QStringList() << "R" << "recursive", QObject::tr("Recursively list the elements of the group."));

const QCommandLineOption List::FlattenOption = QCommandLineOption(QStringList() << "f"
<< "flatten",
QObject::tr("Flattens the output to single lines."));
const QCommandLineOption List::FlattenOption =
QCommandLineOption(QStringList() << "f" << "flatten", QObject::tr("Flattens the output to single lines."));

List::List()
{
Expand Down
3 changes: 1 addition & 2 deletions src/cli/Merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
#include <QCommandLineParser>

const QCommandLineOption Merge::SameCredentialsOption =
QCommandLineOption(QStringList() << "s"
<< "same-credentials",
QCommandLineOption(QStringList() << "s" << "same-credentials",
QObject::tr("Use the same credentials for both database files."));

const QCommandLineOption Merge::KeyFileFromOption =
Expand Down
11 changes: 4 additions & 7 deletions src/cli/Show.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@

#include <QCommandLineParser>

const QCommandLineOption Show::TotpOption = QCommandLineOption(QStringList() << "t"
<< "totp",
QObject::tr("Show the entry's current TOTP."));
const QCommandLineOption Show::TotpOption =
QCommandLineOption(QStringList() << "t" << "totp", QObject::tr("Show the entry's current TOTP."));

const QCommandLineOption Show::ProtectedAttributesOption =
QCommandLineOption(QStringList() << "s"
<< "show-protected",
QCommandLineOption(QStringList() << "s" << "show-protected",
QObject::tr("Show the protected attributes in clear text."));

const QCommandLineOption Show::AllAttributesOption =
Expand All @@ -39,8 +37,7 @@ const QCommandLineOption Show::AttachmentsOption =
QCommandLineOption(QStringList() << "show-attachments", QObject::tr("Show the attachments of the entry."));

const QCommandLineOption Show::AttributesOption = QCommandLineOption(
QStringList() << "a"
<< "attributes",
QStringList() << "a" << "attributes",
QObject::tr(
"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. "
Expand Down
5 changes: 1 addition & 4 deletions src/core/Tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ namespace Tools
constexpr auto kibibyte = 1024;
double size = bytes;

QStringList units = QStringList() << "B"
<< "KiB"
<< "MiB"
<< "GiB";
QStringList units = QStringList() << "B" << "KiB" << "MiB" << "GiB";
int i = 0;
int maxI = units.size() - 1;

Expand Down
7 changes: 1 addition & 6 deletions src/gui/csvImport/CsvImportWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ CsvImportWidget::CsvImportWidget(QWidget* parent)
<< QObject::tr("URL") << QObject::tr("Notes") << QObject::tr("TOTP") << QObject::tr("Icon")
<< QObject::tr("Last Modified") << QObject::tr("Created");

m_fieldSeparatorList << ","
<< ";"
<< "-"
<< ":"
<< "."
<< "\t";
m_fieldSeparatorList << "," << ";" << "-" << ":" << "." << "\t";

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;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dbsettings/DatabaseSettingsWidgetMaintenance.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DatabaseSettingsWidgetMaintenance : public DatabaseSettingsWidget

public slots:
void initialize() override;
void uninitialize() override{};
void uninitialize() override {};
inline bool saveSettings() override
{
return true;
Expand Down
10 changes: 3 additions & 7 deletions src/gui/passkeys/PasskeyImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ void PasskeyImporter::importSelectedFile(QFile& file, QSharedPointer<Database>&
}

const auto privateKey = passkeyObject["privateKey"].toString();
const auto missingKeys = Tools::getMissingValuesFromList<QString>(passkeyObject.keys(),
QStringList() << "relyingParty"
<< "url"
<< "username"
<< "credentialId"
<< "userHandle"
<< "privateKey");
const auto missingKeys = Tools::getMissingValuesFromList<QString>(
passkeyObject.keys(),
QStringList() << "relyingParty" << "url" << "username" << "credentialId" << "userHandle" << "privateKey");
if (!missingKeys.isEmpty()) {
MessageBox::information(m_parent,
tr("Cannot import passkey"),
Expand Down
Loading

0 comments on commit e48ef80

Please sign in to comment.