From 1129303254cbca843848062a96062f0c53b5e22c Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sat, 4 Jan 2025 19:17:36 -0500 Subject: [PATCH] refactor: ActionDialog, when filling the screen list continue sooner if screen is null --- .../deskflow-gui/dialogs/ActionDialog.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/apps/deskflow-gui/dialogs/ActionDialog.cpp b/src/apps/deskflow-gui/dialogs/ActionDialog.cpp index 510f718ac..da52d3649 100644 --- a/src/apps/deskflow-gui/dialogs/ActionDialog.cpp +++ b/src/apps/deskflow-gui/dialogs/ActionDialog.cpp @@ -66,18 +66,18 @@ ActionDialog::ActionDialog(QWidget *parent, const ServerConfig &config, Hotkey & int idx = 0; for (const Screen &screen : config.screens()) { - if (!screen.isNull()) { - QListWidgetItem *pListItem = new QListWidgetItem(screen.name()); - ui->m_pListScreens->addItem(pListItem); - if (m_Action.typeScreenNames().indexOf(screen.name()) != -1) - ui->m_pListScreens->setCurrentItem(pListItem); + if (screen.isNull()) + continue; + QListWidgetItem *pListItem = new QListWidgetItem(screen.name()); + ui->m_pListScreens->addItem(pListItem); + if (m_Action.typeScreenNames().indexOf(screen.name()) != -1) + ui->m_pListScreens->setCurrentItem(pListItem); - ui->m_pComboSwitchToScreen->addItem(screen.name()); - if (screen.name() == m_Action.switchScreenName()) - ui->m_pComboSwitchToScreen->setCurrentIndex(idx); + ui->m_pComboSwitchToScreen->addItem(screen.name()); + if (screen.name() == m_Action.switchScreenName()) + ui->m_pComboSwitchToScreen->setCurrentIndex(idx); - idx++; - } + idx++; } }