Permalink
Browse files

Merge pull request #7079 from spycrab/qt_open_remember

Qt/MainWindow: Remember last directory in "Open" prompt
  • Loading branch information...
spycrab committed Jun 5, 2018
2 parents 21d0d67 + c6704b1 commit 08561b4b43ae80203b937d1dcae6e4a42d5aa4f3
Showing with 12 additions and 2 deletions.
  1. +12 −2 Source/Core/DolphinQt2/MainWindow.cpp
@@ -527,10 +527,20 @@ void MainWindow::RefreshGameList()
QString MainWindow::PromptFileName()
{
return QFileDialog::getOpenFileName(
this, tr("Select a File"), QDir::currentPath(),
auto& settings = Settings::Instance().GetQSettings();
QString path = QFileDialog::getOpenFileName(
this, tr("Select a File"),
settings.value(QStringLiteral("mainwindow/lastdir"), QStringLiteral("")).toString(),
tr("All GC/Wii files (*.elf *.dol *.gcm *.iso *.tgc *.wbfs *.ciso *.gcz *.wad);;"
"All Files (*)"));
if (!path.isEmpty())
{
settings.setValue(QStringLiteral("mainwindow/lastdir"),
QFileInfo(path).absoluteDir().absolutePath());
}
return path;
}
void MainWindow::ChangeDisc()

0 comments on commit 08561b4

Please sign in to comment.