mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor issues
* Remove obsolete code * Fix path modification of a relative folder Replace start token '.' with file path to the project file to make sure that the path './wells/a-1h.dev' can be imported correctly. * Add more logging when keywords are missing from import
This commit is contained in:
@@ -473,38 +473,18 @@ void RimProject::setProjectFileNameAndUpdateDependencies( const QString& project
|
||||
bool foundFile = false;
|
||||
std::vector<QString> searchedPaths;
|
||||
|
||||
QString filePathCandidate = filePath->path();
|
||||
if ( filePathCandidate.startsWith( '.' ) )
|
||||
{
|
||||
filePathCandidate = filePathCandidate.right( filePathCandidate.size() - 1 );
|
||||
filePathCandidate = newProjectPath + filePathCandidate;
|
||||
}
|
||||
|
||||
QString newFilePath =
|
||||
RimTools::relocateFile( filePath->path(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
RimTools::relocateFile( filePathCandidate, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
||||
filePath->setPath( newFilePath );
|
||||
}
|
||||
|
||||
// Update path to well path file cache
|
||||
for ( RimOilField* oilField : oilFields )
|
||||
{
|
||||
if ( oilField == nullptr ) continue;
|
||||
if ( oilField->wellPathCollection() != nullptr )
|
||||
{
|
||||
oilField->wellPathCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
||||
}
|
||||
if ( oilField->formationNamesCollection() != nullptr )
|
||||
{
|
||||
oilField->formationNamesCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
||||
}
|
||||
|
||||
CVF_ASSERT( oilField->fractureDefinitionCollection() );
|
||||
oilField->fractureDefinitionCollection()->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
||||
}
|
||||
|
||||
{
|
||||
std::vector<RimWellLogFile*> rimWellLogFiles;
|
||||
this->descendantsIncludingThisOfType( rimWellLogFiles );
|
||||
|
||||
for ( auto rimWellLogFile : rimWellLogFiles )
|
||||
{
|
||||
rimWellLogFile->updateFilePathsFromProjectPath( newProjectPath, oldProjectPath );
|
||||
}
|
||||
}
|
||||
|
||||
wellPathImport->updateFilePaths();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user