diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index f405a2e1..7f7165ec 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -700,11 +700,16 @@ RzProjectErr MainWindow::saveProject(bool *canceled) RzProjectErr MainWindow::saveProjectAs(bool *canceled) { - QString dir = core->getConfig("prj.file"); - if (dir.isEmpty()) { - dir = QDir(filename).dirName(); + QString projectFile = core->getConfig("prj.file"); + if (projectFile.isEmpty()) { + // preferred name is of fromat 'binary.exe.rzdb' + projectFile = QString("%1.%2").arg(filename).arg("rzdb"); } - QString file = QFileDialog::getSaveFileName(this, tr("Save Project"), dir, PROJECT_FILE_FILTER); + + QFileDialog fileDialog(this); + // Append 'rzdb' suffix if it does not exist + fileDialog.setDefaultSuffix("rzdb"); + QString file = fileDialog.getSaveFileName(this, tr("Save Project"), projectFile, PROJECT_FILE_FILTER); if (file.isEmpty()) { if (canceled) { *canceled = true;