Update SettingsWindow.cpp

This commit is contained in:
okrc 2022-12-23 14:29:35 +08:00 committed by GitHub
parent 62bd1c1b47
commit b6f226b51f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -635,13 +635,10 @@ void CSettingsWindow::LoadSettings()
QTreeWidgetItem* pItem = new QTreeWidgetItem();
AddRunItem(NameCmd.first, NameCmd.second);
}
if (ui.cmbDefault->count() != theAPI->GetAllBoxes().size())
{
ui.cmbDefault->clear();
foreach(const CSandBoxPtr & pBox, theAPI->GetAllBoxes())
ui.cmbDefault->addItem(pBox->GetName().replace("_", " "), pBox->GetName());
}
ui.cmbDefault->clear();
foreach(const CSandBoxPtr & pBox, theAPI->GetAllBoxes())
ui.cmbDefault->addItem(pBox->GetName().replace("_", " "), pBox->GetName());
int pos = ui.cmbDefault->findData(theAPI->GetGlobalSettings()->GetText("DefaultBox", "DefaultBox"));
if(pos == -1)
pos = ui.cmbDefault->findData("DefaultBox");