From d13f6bb870cdda71257f665367be8ef9fca86255 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 17 May 2022 11:47:01 +0200 Subject: Apply clang-format. --- src/settingsdialogworkarounds.cpp | 77 ++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 37 deletions(-) (limited to 'src/settingsdialogworkarounds.cpp') diff --git a/src/settingsdialogworkarounds.cpp b/src/settingsdialogworkarounds.cpp index cf54908a..36e5dd44 100644 --- a/src/settingsdialogworkarounds.cpp +++ b/src/settingsdialogworkarounds.cpp @@ -1,13 +1,13 @@ #include "settingsdialogworkarounds.h" -#include "ui_settingsdialog.h" -#include "spawn.h" #include "settings.h" -#include +#include "spawn.h" +#include "ui_settingsdialog.h" #include #include +#include WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d) - : SettingsTab(s, d) + : SettingsTab(s, d) { // options ui->forceEnableBox->setChecked(settings().game().forceEnableCoreFiles()); @@ -35,9 +35,15 @@ WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d) // buttons m_ExecutableBlacklist = settings().executablesBlacklist(); - QObject::connect(ui->bsaDateBtn, &QPushButton::clicked, [&]{ on_bsaDateBtn_clicked(); }); - QObject::connect(ui->execBlacklistBtn, &QPushButton::clicked, [&]{ on_execBlacklistBtn_clicked(); }); - QObject::connect(ui->resetGeometryBtn, &QPushButton::clicked, [&]{ on_resetGeometryBtn_clicked(); }); + QObject::connect(ui->bsaDateBtn, &QPushButton::clicked, [&] { + on_bsaDateBtn_clicked(); + }); + QObject::connect(ui->execBlacklistBtn, &QPushButton::clicked, [&] { + on_execBlacklistBtn_clicked(); + }); + QObject::connect(ui->resetGeometryBtn, &QPushButton::clicked, [&] { + on_resetGeometryBtn_clicked(); + }); } void WorkaroundsSettingsTab::update() @@ -65,12 +71,11 @@ void WorkaroundsSettingsTab::update() settings().setExecutablesBlacklist(m_ExecutableBlacklist); } -bool WorkaroundsSettingsTab::changeBlacklistNow( - QWidget* parent, Settings& settings) +bool WorkaroundsSettingsTab::changeBlacklistNow(QWidget* parent, Settings& settings) { const auto current = settings.executablesBlacklist(); - if (auto s=changeBlacklistLater(parent, current)) { + if (auto s = changeBlacklistLater(parent, current)) { settings.setExecutablesBlacklist(*s); return true; } @@ -78,23 +83,22 @@ bool WorkaroundsSettingsTab::changeBlacklistNow( return false; } -std::optional WorkaroundsSettingsTab::changeBlacklistLater( - QWidget* parent, const QString& current) +std::optional +WorkaroundsSettingsTab::changeBlacklistLater(QWidget* parent, const QString& current) { bool ok = false; QString result = QInputDialog::getMultiLineText( - parent, - QObject::tr("Executables Blacklist"), - QObject::tr("Enter one executable per line to be blacklisted from the virtual file system.\n" - "Mods and other virtualized files will not be visible to these executables and\n" - "any executables launched by them.\n\n" - "Example:\n" - " Chrome.exe\n" - " Firefox.exe"), - current.split(";").join("\n"), - &ok - ); + parent, QObject::tr("Executables Blacklist"), + QObject::tr("Enter one executable per line to be blacklisted from the virtual " + "file system.\n" + "Mods and other virtualized files will not be visible to these " + "executables and\n" + "any executables launched by them.\n\n" + "Example:\n" + " Chrome.exe\n" + " Firefox.exe"), + current.split(";").join("\n"), &ok); if (!ok) { return {}; @@ -112,7 +116,7 @@ std::optional WorkaroundsSettingsTab::changeBlacklistLater( void WorkaroundsSettingsTab::on_execBlacklistBtn_clicked() { - if (auto s=changeBlacklistLater(parentWidget(), m_ExecutableBlacklist)) { + if (auto s = changeBlacklistLater(parentWidget(), m_ExecutableBlacklist)) { m_ExecutableBlacklist = *s; } } @@ -120,24 +124,23 @@ void WorkaroundsSettingsTab::on_execBlacklistBtn_clicked() void WorkaroundsSettingsTab::on_bsaDateBtn_clicked() { const auto* game = qApp->property("managed_game").value(); - QDir dir = game->dataDirectory(); + QDir dir = game->dataDirectory(); - helper::backdateBSAs( - parentWidget(), - qApp->applicationDirPath().toStdWString(), - dir.absolutePath().toStdWString()); + helper::backdateBSAs(parentWidget(), qApp->applicationDirPath().toStdWString(), + dir.absolutePath().toStdWString()); } void WorkaroundsSettingsTab::on_resetGeometryBtn_clicked() { - const auto r = MOBase::TaskDialog(parentWidget()) - .title(QObject::tr("Restart Mod Organizer")) - .main(QObject::tr("Restart Mod Organizer")) - .content(QObject::tr("Geometries will be reset to their default values.")) - .icon(QMessageBox::Question) - .button({QObject::tr("Restart Mod Organizer"), QMessageBox::Ok}) - .button({QObject::tr("Cancel"), QMessageBox::Cancel}) - .exec(); + const auto r = + MOBase::TaskDialog(parentWidget()) + .title(QObject::tr("Restart Mod Organizer")) + .main(QObject::tr("Restart Mod Organizer")) + .content(QObject::tr("Geometries will be reset to their default values.")) + .icon(QMessageBox::Question) + .button({QObject::tr("Restart Mod Organizer"), QMessageBox::Ok}) + .button({QObject::tr("Cancel"), QMessageBox::Cancel}) + .exec(); if (r == QMessageBox::Ok) { settings().geometry().requestReset(); -- cgit v1.3.1