mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Copy changes from dev-branch into main
History of main branch was difficult to merge. Take a copy of dev-branch, and merge both ways between dev and main after the release.
This commit is contained in:
@@ -35,10 +35,10 @@ CAF_CMD_SOURCE_INIT( RicComputeStatisticsFeature, "RicComputeStatisticsFeature"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicComputeStatisticsFeature::isCommandEnabled()
|
||||
bool RicComputeStatisticsFeature::isCommandEnabled() const
|
||||
{
|
||||
std::vector<RimEclipseStatisticsCase*> selection = selectedCases();
|
||||
if ( selection.size() > 0 )
|
||||
if ( !selection.empty() )
|
||||
{
|
||||
RimEclipseStatisticsCase* statisticsCase = selection[0];
|
||||
if ( statisticsCase )
|
||||
@@ -46,7 +46,7 @@ bool RicComputeStatisticsFeature::isCommandEnabled()
|
||||
RimIdenticalGridCaseGroup* gridCaseGroup = statisticsCase->firstAncestorOrThisOfType<RimIdenticalGridCaseGroup>();
|
||||
|
||||
RimCaseCollection* caseCollection = gridCaseGroup ? gridCaseGroup->caseCollection() : nullptr;
|
||||
return caseCollection ? caseCollection->reservoirs.size() > 0 : false;
|
||||
return caseCollection ? !caseCollection->reservoirs.empty() : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ bool RicComputeStatisticsFeature::isCommandEnabled()
|
||||
void RicComputeStatisticsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
std::vector<RimEclipseStatisticsCase*> selection = selectedCases();
|
||||
if ( selection.size() > 0 )
|
||||
if ( !selection.empty() )
|
||||
{
|
||||
RimEclipseStatisticsCase* statisticsCase = selection[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user