Do not use default filename as default for "Save as"

This may sound counterintuitive but it actually makes sense.
If you have a default filename that's the name of you "normal working
file". If you want "Save as" something, that by definition is NOT your
normal working file but a subset or an experiment or something. And you
most definitely do NOT want to overwrite your default file with that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-14 06:13:03 +09:00
parent c86d055db7
commit ed6a42f6f2

View file

@ -965,12 +965,7 @@ void MainWindow::recentFileTriggered(bool checked)
int MainWindow::file_save_as(void)
{
QString filename;
const char *default_filename;
if (existing_filename)
default_filename = existing_filename;
else
default_filename = prefs.default_filename;
const char *default_filename = existing_filename;
filename = QFileDialog::getSaveFileName(this, tr("Save File as"), default_filename,
tr("Subsurface XML files (*.ssrf *.xml *.XML)"));
if (filename.isNull() || filename.isEmpty())