mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 20:16:16 +00:00
With no filename set pick reasonable directory for Save as
If the user has no default filename set and starts Subsurface without a filename, the directory that is opened with Save as ends up being the current working directory of the executable, which might be its installation directory - which in general is not a good place to save data files to. With this change we pick the directory which is usually used for the default file, which should give us reasonable places on all OSs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1719a7f59e
commit
021af81443
1 changed files with 4 additions and 1 deletions
|
@ -1433,7 +1433,10 @@ int MainWindow::file_save_as(void)
|
|||
selection_dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
selection_dialog.setFileMode(QFileDialog::AnyFile);
|
||||
selection_dialog.setDefaultSuffix("");
|
||||
|
||||
if (same_string(default_filename, "")) {
|
||||
QFileInfo defaultFile(system_default_filename());
|
||||
selection_dialog.setDirectory(qPrintable(defaultFile.absolutePath()));
|
||||
}
|
||||
/* if the exit/cancel button is pressed return */
|
||||
if (!selection_dialog.exec())
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue