Skip to content

Commit

Permalink
Fix grid file installation fails if path does not already exist
Browse files Browse the repository at this point in the history
Fixes #32936
  • Loading branch information
nyalldawson committed Nov 25, 2019
1 parent 3ba9515 commit 97fd59a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsinstallgridshiftdialog.cpp
Expand Up @@ -59,7 +59,11 @@ void QgsInstallGridShiftFileDialog::installFromFile()
QFileInfo fi( gridFilePath );
settings.setValue( QStringLiteral( "lastTransformGridFolder" ), fi.absolutePath(), QgsSettings::App );

const QString destPath = QgsApplication::qgisSettingsDirPath() + QStringLiteral( "proj/" ) + fi.fileName();
const QString baseGridPath = QgsApplication::qgisSettingsDirPath() + QStringLiteral( "proj" );
if ( !QDir( baseGridPath ).exists() )
QDir().mkdir( baseGridPath );

const QString destPath = baseGridPath + '/' + fi.fileName();

if ( QFile::copy( gridFilePath, destPath ) )
{
Expand Down

0 comments on commit 97fd59a

Please sign in to comment.