mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Always move views from obsolete fields into view collection
The original code caused ProjectFiles2024Tests\TestCase_GridCalculations to fail
This commit is contained in:
@@ -279,31 +279,28 @@ void RimEclipseCase::initAfterRead()
|
|||||||
{
|
{
|
||||||
RimCase::initAfterRead();
|
RimCase::initAfterRead();
|
||||||
|
|
||||||
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2024.03.0" ) )
|
// Move views to view collection.
|
||||||
|
RimEclipseViewCollection* viewColl = viewCollection();
|
||||||
|
for ( RimEclipseView* riv : m_reservoirViews_OBSOLETE.childrenByType() )
|
||||||
{
|
{
|
||||||
// Move views to view collection.
|
CVF_ASSERT( riv );
|
||||||
RimEclipseViewCollection* viewColl = viewCollection();
|
riv->setEclipseCase( this );
|
||||||
for ( RimEclipseView* riv : m_reservoirViews_OBSOLETE.childrenByType() )
|
m_reservoirViews_OBSOLETE.removeChild( riv );
|
||||||
{
|
viewColl->addView( riv );
|
||||||
CVF_ASSERT( riv );
|
|
||||||
riv->setEclipseCase( this );
|
|
||||||
m_reservoirViews_OBSOLETE.removeChild( riv );
|
|
||||||
viewColl->addView( riv );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_reservoirViews_OBSOLETE.clearWithoutDelete();
|
|
||||||
|
|
||||||
// Move contour maps
|
|
||||||
auto mapViewColl = contourMapCollection();
|
|
||||||
for ( RimEclipseContourMapView* contourMap : m_contourMapCollection_OBSOLETE->views() )
|
|
||||||
{
|
|
||||||
contourMap->setEclipseCase( this );
|
|
||||||
m_contourMapCollection_OBSOLETE->removeChild( contourMap );
|
|
||||||
mapViewColl->addView( contourMap );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_contourMapCollection_OBSOLETE->clearWithoutDelete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_reservoirViews_OBSOLETE.clearWithoutDelete();
|
||||||
|
|
||||||
|
// Move contour maps
|
||||||
|
auto mapViewColl = contourMapCollection();
|
||||||
|
for ( RimEclipseContourMapView* contourMap : m_contourMapCollection_OBSOLETE->views() )
|
||||||
|
{
|
||||||
|
contourMap->setEclipseCase( this );
|
||||||
|
m_contourMapCollection_OBSOLETE->removeChild( contourMap );
|
||||||
|
mapViewColl->addView( contourMap );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_contourMapCollection_OBSOLETE->clearWithoutDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user