(#672) Avoid deleting and hiding WellLogPlot and Wells folders when they have no children

This commit is contained in:
Jacob Støren 2015-11-30 15:07:54 +01:00
parent 9d9ff798a9
commit 704f4fa42b
2 changed files with 7 additions and 5 deletions

View File

@ -37,6 +37,7 @@ RimOilField::RimOilField(void)
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
analysisModels = new RimEclipseCaseCollection();
wellPathCollection = new RimWellPathCollection();
}
//--------------------------------------------------------------------------------------------------

View File

@ -139,7 +139,11 @@ RimProject::~RimProject(void)
//--------------------------------------------------------------------------------------------------
void RimProject::close()
{
if (mainPlotCollection()) delete mainPlotCollection();
if (mainPlotCollection() && mainPlotCollection()->wellLogPlotCollection())
{
mainPlotCollection()->wellLogPlotCollection()->wellLogPlots.deleteAllChildObjects();
}
oilFields.deleteAllChildObjects();
oilFields.push_back(new RimOilField);
@ -723,10 +727,7 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
{
if (mainPlotCollection->wellLogPlotCollection())
{
if (mainPlotCollection->wellLogPlotCollection()->wellLogPlots().size() > 0)
{
uiTreeOrdering.add(mainPlotCollection->wellLogPlotCollection());
}
uiTreeOrdering.add(mainPlotCollection->wellLogPlotCollection());
}
}