Skip to content

Commit

Permalink
avoid 'overwriting' readonly files (fixes #9617)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 22, 2014
1 parent 694e5da commit efc507a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -3757,6 +3757,17 @@ bool QgisApp::fileSave()

QgsProject::instance()->setFileName( fullPath.filePath() );
}
else
{
QFileInfo fi( QgsProject::instance()->fileName() );
if ( fi.exists() && ! fi.isWritable() )
{
messageBar()->pushMessage( tr( "Insufficient permissions" ),
tr( "The project file is not writable." ),
QgsMessageBar::WARNING );
return false;
}
}

if ( QgsProject::instance()->write() )
{
Expand Down

0 comments on commit efc507a

Please sign in to comment.