Modifications to SaveFile-Dialog for "Save As PDF"

Fixed a typo that prevented existing PDF files from being displayed in SaveFileDialog for PDFs.

The way the file name for the PDF is generated has changed. If the project has already been saved, the PDF has the same file name (with .pdf of course); If not, the file name is generated from the project title (= same behavior as Save as - dialog for a .qet project file).
This commit is contained in:
Lars Biskupek
2021-02-22 12:50:49 +01:00
committed by joshua
parent fb58ecacfc
commit 3e95b51af6

View File

@@ -95,13 +95,13 @@ void ProjectPrintWindow::launchDialog(QETProject *project, QPrinter::OutputForma
QString ProjectPrintWindow::docName(QETProject *project)
{
QString doc_name;
if (!project->title().isEmpty()) {
doc_name = project->title();
} else if (!project->filePath().isEmpty()) {
if (!project->filePath().isEmpty()) {
doc_name = QFileInfo(project->filePath()).baseName();
} else if (!project->title().isEmpty()) {
doc_name = project->title();
doc_name = QET::stringToFileName(doc_name);
}
doc_name = QET::stringToFileName(doc_name);
if (doc_name.isEmpty()) {
doc_name = tr("projet", "string used to generate a filename");
}