Qt/MappingWindow: Fix profile saving not working when the index is not null

This commit is contained in:
spycrab 2018-05-29 01:26:17 +02:00
parent 5829ad21b7
commit e6273b177f
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ void MappingWindow::OnSaveProfilePressed()
m_controller->SaveConfig(ini.GetOrCreateSection("Profile")); m_controller->SaveConfig(ini.GetOrCreateSection("Profile"));
ini.Save(profile_path); ini.Save(profile_path);
if (m_profiles_combo->currentIndex() == 0) if (m_profiles_combo->currentIndex() == 0 || m_profiles_combo->findText(profile_name) == -1)
{ {
m_profiles_combo->addItem(profile_name, QString::fromStdString(profile_path)); m_profiles_combo->addItem(profile_name, QString::fromStdString(profile_path));
m_profiles_combo->setCurrentIndex(m_profiles_combo->count() - 1); m_profiles_combo->setCurrentIndex(m_profiles_combo->count() - 1);