diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2018-06-05 19:02:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-05 19:02:17 +0200 |
| commit | 08561b4b43ae80203b937d1dcae6e4a42d5aa4f3 (patch) | |
| tree | a297edb5a47a2b78b30e88cf571702dc82110be2 /Source/Core/DolphinQt2/MainWindow.cpp | |
| parent | 21d0d6711f695d50e3a1cc76f0a075433e46f880 (diff) | |
| parent | c6704b1323175f28b621ec8ce2f1278b86a16683 (diff) | |
Merge pull request #7079 from spycrab/qt_open_remember
Qt/MainWindow: Remember last directory in "Open" prompt
Diffstat (limited to 'Source/Core/DolphinQt2/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/MainWindow.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index d334806cf1..39a50e72f0 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/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() |
