Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Save qgs file even if saving the qgd file is failing
  • Loading branch information
pblottiere committed Jun 15, 2021
1 parent 51c0886 commit 0e3c2ea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/core/project/qgsproject.cpp
Expand Up @@ -672,6 +672,7 @@ QgsProjectStorage *QgsProject::projectStorage() const

QDateTime QgsProject::lastModified() const
{
std::cout << "QgsProject::lastModified " << mFile.fileName().toStdString() << std::endl;
if ( QgsProjectStorage *storage = projectStorage() )
{
QgsProjectStorage::Metadata metadata;
Expand Down Expand Up @@ -3341,25 +3342,30 @@ bool QgsProject::zip( const QString &filename )
const QFileInfo info( qgsFile );
const QString asFileName = info.path() + QDir::separator() + info.completeBaseName() + "." + QgsAuxiliaryStorage::extension();

bool asOk = true;
if ( ! saveAuxiliaryStorage( asFileName ) )
{
const QString err = mAuxiliaryStorage->errorString();
setError( tr( "Unable to save auxiliary storage ('%1')" ).arg( err ) );
return false;
asOk = false;
}
else
{
archive->addFile( asFileName );
}

// create the archive
archive->addFile( qgsFile.fileName() );
archive->addFile( asFileName );

// zip
bool zipOk = true;
if ( !archive->zip( filename ) )
{
setError( tr( "Unable to perform zip" ) );
return false;
zipOk = false;
}

return true;
return asOk && zipOk;
}

bool QgsProject::isZipped() const
Expand Down

0 comments on commit 0e3c2ea

Please sign in to comment.