From 63b835f822e5167aa529f2c27c5df136defef6eb Mon Sep 17 00:00:00 2001 From: flodavid Date: Sat, 16 Dec 2023 18:26:26 +0100 Subject: Save profile name used - Save the profile name in global config - Read the profile name when reading the global config --- src/yuzu/configuration/configure_input_player.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/yuzu/configuration/configure_input_player.cpp') diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index f3552191a..9745757c7 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -1650,9 +1650,21 @@ void ConfigureInputPlayer::SaveProfile() { void ConfigureInputPlayer::UpdateInputProfiles() { ui->comboProfiles->clear(); - for (const auto& profile_name : profiles->GetInputProfileNames()) { + // Set current profile as empty by default + int profile_index = -1; + + // Add every available profile and search the player profile to set it as current one + auto& current_profile = Settings::values.players.GetValue()[player_index].profile_name; + std::vector profile_names = profiles->GetInputProfileNames(); + std::string profile_name; + for (size_t i = 0; i < profile_names.size(); i++) { + profile_name = profile_names[i]; ui->comboProfiles->addItem(QString::fromStdString(profile_name)); + if (current_profile == profile_name) { + profile_index = (int)i; + } } - ui->comboProfiles->setCurrentIndex(-1); + LOG_DEBUG(Frontend, "Setting the current input profile to index {}", profile_index); + ui->comboProfiles->setCurrentIndex(profile_index); } -- cgit v1.2.3