Do not allow opening the same odb file twice. The odb reader does not support that.

This commit is contained in:
Jon Jenssen
2020-09-14 17:06:16 +02:00
committed by Magne Sjaastad
parent 8ecd3c3c33
commit cbadfd456a
2 changed files with 25 additions and 7 deletions

View File

@@ -78,6 +78,15 @@ RimGeoMechCase* RimGeoMechModels::copyCase( RimGeoMechCase* thecase, const QStri
{
std::vector<RimGeoMechCase*> newcases;
for ( auto gmcase : m_cases() )
{
if ( gmcase->gridFileName() == newInputFileName )
{
RiaLogging::warning( "File has already been opened. Cannot open the file twice! - " + newInputFileName );
return nullptr;
}
}
RimGeoMechCase* copy = thecase->createCopy( newInputFileName );
if ( !copy )
{