mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-29 08:30:17 -05:00
Make sure the ensemble file sets are relocated
Use similar logic as relocation of caf::FilePath. Not possible to reuse code, as RimTools::relocateFile checks if the candidate file is present on the file system.
This commit is contained in:
1 parent
edc9cec0a4
commit
4e66b521f8
5 files changed
+36
-3
No files matched your search
@@ -17,7 +17,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimEnsembleFileSetCollection.h"
|
||||
|
||||
#include "RimEnsembleFileSet.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
@@ -79,6 +81,22 @@ void RimEnsembleFileSetCollection::deleteFileSetIfPossible( RimEnsembleFileSet*
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleFileSetCollection::updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath )
|
||||
{
|
||||
for ( auto fileSet : fileSets() )
|
||||
{
|
||||
auto pattern = fileSet->pathPattern();
|
||||
auto updatedPattern = RimTools::relocatePathPattern( pattern, newProjectPath, oldProjectPath );
|
||||
if ( updatedPattern != pattern )
|
||||
{
|
||||
fileSet->setPathPattern( updatedPattern );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user