diff --git a/src/app/qgsmapsavedialog.cpp b/src/app/qgsmapsavedialog.cpp index 02bbcdfd5482..feaf15651de0 100644 --- a/src/app/qgsmapsavedialog.cpp +++ b/src/app/qgsmapsavedialog.cpp @@ -43,7 +43,7 @@ #include "qgsmessagebar.h" #include "qgsapplication.h" #include "qgsexpressioncontextutils.h" - +#include "qgsfileutils.h" Q_GUI_EXPORT extern int qt_defaultDpiX(); @@ -467,6 +467,8 @@ void QgsMapSaveDialog::onAccepted() QString fileName = QFileDialog::getSaveFileName( QgisApp::instance(), tr( "Save Map As" ), lastUsedDir, tr( "PDF Format" ) + " (*.pdf *.PDF)" ); if ( !fileName.isEmpty() ) { + fileName = QgsFileUtils::ensureFileNameHasExtension( fileName, QStringList() << QStringLiteral( "pdf" ) ); + settings.setValue( QStringLiteral( "UI/lastSaveAsImageDir" ), QFileInfo( fileName ).absolutePath() ); QgsMapSettings ms = QgsMapSettings(); diff --git a/src/ui/qgsmapsavedialog.ui b/src/ui/qgsmapsavedialog.ui index f835c7ce95d3..07cc9c5c32f6 100644 --- a/src/ui/qgsmapsavedialog.ui +++ b/src/ui/qgsmapsavedialog.ui @@ -15,7 +15,7 @@ - + @@ -43,7 +43,7 @@ - + Create Geospatial PDF (GeoPDF) @@ -105,7 +105,7 @@ 20 - 40 + 133 @@ -158,7 +158,7 @@ - + false @@ -287,16 +287,13 @@ Rasterizing the map is recommended when such effects are used. - + false - - -