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:
Magne Sjaastad committed 2025-05-26 11:17:53 +02:00
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 );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------