mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-23 21:35:28 +00:00
Better handle project names (#2603)
This commit is contained in:
parent
de234e600e
commit
6cbf0c0cbf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user