Qt/PathPane: Update "Default ISO" when changed

This commit is contained in:
spycrab 2018-07-01 18:20:01 +02:00
parent 9cfcbfacbe
commit 37e936fa9e
2 changed files with 5 additions and 8 deletions

View File

@ -549,7 +549,8 @@ void GameList::UninstallWAD()
void GameList::SetDefaultISO() void GameList::SetDefaultISO()
{ {
SConfig::GetInstance().m_strDefaultISO = GetSelectedGame()->GetFilePath(); Settings::Instance().SetDefaultGame(
QDir::toNativeSeparators(QString::fromStdString(GetSelectedGame()->GetFilePath())));
} }
void GameList::OpenContainingFolder() void GameList::OpenContainingFolder()

View File

@ -41,17 +41,13 @@ void PathPane::Browse()
void PathPane::BrowseDefaultGame() void PathPane::BrowseDefaultGame()
{ {
auto& default_iso = SConfig::GetInstance().m_strDefaultISO;
QString file = QDir::toNativeSeparators(QFileDialog::getOpenFileName( 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);;" tr("All GC/Wii files (*.elf *.dol *.gcm *.iso *.tgc *.wbfs *.ciso *.gcz *.wad);;"
"All Files (*)"))); "All Files (*)")));
if (!file.isEmpty()) if (!file.isEmpty())
{ Settings::Instance().SetDefaultGame(file);
m_game_edit->setText(file);
default_iso = file.toStdString();
}
} }
void PathPane::BrowseWiiNAND() void PathPane::BrowseWiiNAND()