Merge pull request #7079 from spycrab/qt_open_remember
Qt/MainWindow: Remember last directory in "Open" prompt
This commit is contained in:
commit
08561b4b43
|
@ -527,10 +527,20 @@ void MainWindow::RefreshGameList()
|
||||||
|
|
||||||
QString MainWindow::PromptFileName()
|
QString MainWindow::PromptFileName()
|
||||||
{
|
{
|
||||||
return QFileDialog::getOpenFileName(
|
auto& settings = Settings::Instance().GetQSettings();
|
||||||
this, tr("Select a File"), QDir::currentPath(),
|
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);;"
|
tr("All GC/Wii files (*.elf *.dol *.gcm *.iso *.tgc *.wbfs *.ciso *.gcz *.wad);;"
|
||||||
"All Files (*)"));
|
"All Files (*)"));
|
||||||
|
|
||||||
|
if (!path.isEmpty())
|
||||||
|
{
|
||||||
|
settings.setValue(QStringLiteral("mainwindow/lastdir"),
|
||||||
|
QFileInfo(path).absoluteDir().absolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ChangeDisc()
|
void MainWindow::ChangeDisc()
|
||||||
|
|
Loading…
Reference in New Issue