From 37e936fa9e4cad4760cc24ce36613f6eb47f5f5f Mon Sep 17 00:00:00 2001 From: spycrab Date: Sun, 1 Jul 2018 18:20:01 +0200 Subject: [PATCH] Qt/PathPane: Update "Default ISO" when changed --- Source/Core/DolphinQt2/GameList/GameList.cpp | 3 ++- Source/Core/DolphinQt2/Settings/PathPane.cpp | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp index 6bcbfb88b9..8cb80dafbb 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.cpp +++ b/Source/Core/DolphinQt2/GameList/GameList.cpp @@ -549,7 +549,8 @@ void GameList::UninstallWAD() void GameList::SetDefaultISO() { - SConfig::GetInstance().m_strDefaultISO = GetSelectedGame()->GetFilePath(); + Settings::Instance().SetDefaultGame( + QDir::toNativeSeparators(QString::fromStdString(GetSelectedGame()->GetFilePath()))); } void GameList::OpenContainingFolder() diff --git a/Source/Core/DolphinQt2/Settings/PathPane.cpp b/Source/Core/DolphinQt2/Settings/PathPane.cpp index ee6441d7e7..e7f9f042e5 100644 --- a/Source/Core/DolphinQt2/Settings/PathPane.cpp +++ b/Source/Core/DolphinQt2/Settings/PathPane.cpp @@ -41,17 +41,13 @@ void PathPane::Browse() void PathPane::BrowseDefaultGame() { - auto& default_iso = SConfig::GetInstance().m_strDefaultISO; - QString file = QDir::toNativeSeparators(QFileDialog::getOpenFileName( - this, tr("Select a Game"), QString::fromStdString(default_iso), + this, tr("Select a Game"), Settings::Instance().GetDefaultGame(), tr("All GC/Wii files (*.elf *.dol *.gcm *.iso *.tgc *.wbfs *.ciso *.gcz *.wad);;" "All Files (*)"))); + if (!file.isEmpty()) - { - m_game_edit->setText(file); - default_iso = file.toStdString(); - } + Settings::Instance().SetDefaultGame(file); } void PathPane::BrowseWiiNAND()