mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 11:26:11 +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)
|
RzProjectErr MainWindow::saveProjectAs(bool *canceled)
|
||||||
{
|
{
|
||||||
QString dir = core->getConfig("prj.file");
|
QString projectFile = core->getConfig("prj.file");
|
||||||
if (dir.isEmpty()) {
|
if (projectFile.isEmpty()) {
|
||||||
dir = QDir(filename).dirName();
|
// 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 (file.isEmpty()) {
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
*canceled = true;
|
*canceled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user