(#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", "", ""); CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
analysisModels = new RimEclipseCaseCollection(); analysisModels = new RimEclipseCaseCollection();
wellPathCollection = new RimWellPathCollection();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

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