use brackets in one-liner if statements

This commit is contained in:
RickyRister 2024-11-20 09:13:12 -08:00
parent d44b62badc
commit 977e4ed57b

View file

@ -769,8 +769,9 @@ void TabDeckEditor::actNewDeck()
{ {
auto deckOpenLocation = confirmOpen(false); auto deckOpenLocation = confirmOpen(false);
if (deckOpenLocation == CANCELLED) if (deckOpenLocation == CANCELLED) {
return; return;
}
if (deckOpenLocation == NEW_TAB) { if (deckOpenLocation == NEW_TAB) {
emit openDeckEditor(nullptr); emit openDeckEditor(nullptr);
@ -789,8 +790,9 @@ void TabDeckEditor::actLoadDeck()
{ {
auto deckOpenLocation = confirmOpen(); auto deckOpenLocation = confirmOpen();
if (deckOpenLocation == CANCELLED) if (deckOpenLocation == CANCELLED) {
return; return;
}
QFileDialog dialog(this, tr("Load deck")); QFileDialog dialog(this, tr("Load deck"));
dialog.setDirectory(SettingsCache::instance().getDeckPath()); dialog.setDirectory(SettingsCache::instance().getDeckPath());
@ -882,8 +884,9 @@ void TabDeckEditor::actLoadDeckFromClipboard()
{ {
auto deckOpenLocation = confirmOpen(); auto deckOpenLocation = confirmOpen();
if (deckOpenLocation == CANCELLED) if (deckOpenLocation == CANCELLED) {
return; return;
}
DlgLoadDeckFromClipboard dlg(this); DlgLoadDeckFromClipboard dlg(this);
if (!dlg.exec()) if (!dlg.exec())
@ -1028,8 +1031,9 @@ TabDeckEditor::DeckOpenLocation TabDeckEditor::confirmOpen(const bool openInSame
// `exec()` returns an opaque value if a non-standard button was clicked. // `exec()` returns an opaque value if a non-standard button was clicked.
// Directly check if newTabButton was clicked before switching over the standard buttons. // Directly check if newTabButton was clicked before switching over the standard buttons.
if (msgBox.clickedButton() == newTabButton) if (msgBox.clickedButton() == newTabButton) {
return NEW_TAB; return NEW_TAB;
}
switch (ret) { switch (ret) {
case QMessageBox::Save: case QMessageBox::Save: