diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2018-05-01 19:26:22 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-01 19:26:22 +1000 |
| commit | 42d73deaed9e79e8d2e45c1a0ebfa69d19a9c9b3 (patch) | |
| tree | fd8fe4d53dc81e8fd25abd5d5b171c0178301073 /Source/Core | |
| parent | ad098283c023b0f5f0d314c646bc5d5756c35e3d (diff) | |
| parent | c6a0a4318de45b6c206e4476c6266809bc942603 (diff) | |
Merge pull request #6723 from spycrab/qt_fix_profile_save
Qt/MappingWindow: Fix profile saving
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp index e375cb96a6..21898b3f47 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp @@ -39,6 +39,8 @@ #include "InputCommon/ControllerInterface/Device.h" #include "InputCommon/InputConfig.h" +constexpr const char* PROFILES_DIR = "Profiles/"; + MappingWindow::MappingWindow(QWidget* parent, Type type, int port_num) : QDialog(parent), m_port(port_num) { @@ -197,21 +199,22 @@ void MappingWindow::OnLoadProfilePressed() void MappingWindow::OnSaveProfilePressed() { const QString profile_name = m_profiles_combo->currentText(); - const QString profile_path = m_profiles_combo->currentData().toString(); + const std::string profile_path = + File::GetUserPath(D_CONFIG_IDX) + PROFILES_DIR + profile_name.toStdString() + ".ini"; if (profile_name.isEmpty()) return; - File::CreateFullPath(profile_path.toStdString()); + File::CreateFullPath(profile_path); IniFile ini; m_controller->SaveConfig(ini.GetOrCreateSection("Profile")); - ini.Save(profile_path.toStdString()); + ini.Save(profile_path); if (m_profiles_combo->currentIndex() == 0) { - m_profiles_combo->addItem(profile_name, profile_path); + m_profiles_combo->addItem(profile_name, QString::fromStdString(profile_path)); m_profiles_combo->setCurrentIndex(m_profiles_combo->count() - 1); } } @@ -305,7 +308,7 @@ void MappingWindow::SetMappingType(MappingWindow::Type type) m_profiles_combo->addItem(QStringLiteral("")); const std::string profiles_path = - File::GetUserPath(D_CONFIG_IDX) + "Profiles/" + m_config->GetProfileName(); + File::GetUserPath(D_CONFIG_IDX) + PROFILES_DIR + m_config->GetProfileName(); for (const auto& filename : Common::DoFileSearch({profiles_path}, {".ini"})) { std::string basename; |
