mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Use getSaveFileName() as the file open dialog
This way we can specify file names that don't exist and therefore make our git syntax (/path/to/dir[branch]) work. Thanks to Tomaz for pointing this out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
61cc1c4dbe
commit
fc7f0c6215
1 changed files with 4 additions and 1 deletions
|
@ -208,7 +208,10 @@ void MainWindow::on_actionOpen_triggered()
|
||||||
if (!okToClose(tr("Please save or cancel the current dive edit before opening a new file.")))
|
if (!okToClose(tr("Please save or cancel the current dive edit before opening a new file.")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open file"), lastUsedDir(), filter());
|
// yes, this look wrong to use getSaveFileName() for the open dialog, but we need to be able
|
||||||
|
// to enter file names that don't exist in order to use our git syntax /path/to/dir[branch]
|
||||||
|
// with is a potentially valid input, but of course won't exist. So getOpenFileName() wouldn't work
|
||||||
|
QString filename = QFileDialog::getSaveFileName(this, tr("Open file"), lastUsedDir(), filter());
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
return;
|
return;
|
||||||
updateLastUsedDir(QFileInfo(filename).dir().path());
|
updateLastUsedDir(QFileInfo(filename).dir().path());
|
||||||
|
|
Loading…
Reference in a new issue