mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
11402 Save copy of project file to a backup database when saving project file
This commit is contained in:
1 parent
3cd80f0871
commit
4617bcc673
10 files changed
+220
-11
No files matched your search
@@ -24,6 +24,8 @@
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaProjectBackupTools.h"
|
||||
#include "RiaProjectFileVersionTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
@@ -405,10 +407,22 @@ RimMainPlotCollection* RimProject::mainPlotCollection() const
|
||||
bool RimProject::writeProjectFile()
|
||||
{
|
||||
transferPathsToGlobalPathList();
|
||||
bool couldOpenFile = writeFile();
|
||||
|
||||
QFile xmlFile( fileName );
|
||||
if ( !xmlFile.open( QIODevice::WriteOnly | QIODevice::Text ) ) return false;
|
||||
|
||||
QString content = documentAsString();
|
||||
xmlFile.write( content.toUtf8() );
|
||||
|
||||
if ( RiaPreferences::current()->storeBackupOfProjectFiles() )
|
||||
{
|
||||
QString backupFilename = fileName + "db";
|
||||
RiaProjectBackupTools::appendTextToDatabase( backupFilename, content );
|
||||
}
|
||||
|
||||
distributePathsFromGlobalPathList();
|
||||
|
||||
return couldOpenFile;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user