Fix selecting the profile in the dialog

Previously, when clicking the "select" button in the profiles
dialog (when the dialog was launched in the menu or toolbar),
everything would be refreshed without checking the selected
profile in the dialog.

Now, the selected profile is set with some signal blocking to
help prevent redundant refreshes from occurring.
This commit is contained in:
Chris Bessent
2021-04-25 05:09:58 -07:00
parent 40a4bf1e3a
commit 8308dfcbff
+9
View File
@@ -2148,6 +2148,15 @@ void MainWindow::on_actionAdd_Profile_triggered()
profilesDialog.exec();
m_SavesTab->refreshSaveList(); // since the save list may now be outdated we have to refresh it completely
if (profilesDialog.selectedProfile())
{
// Change profile while blocking signals to prevent extra signals being sent
// Doesn't matter much as refreshProfiles() is being called after this
ui->profileBox->blockSignals(true);
ui->profileBox->setCurrentText(profilesDialog.selectedProfile().value());
ui->profileBox->blockSignals(false);
}
if (refreshProfiles() && !profilesDialog.failed()) {
break;
}