mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1059 System : Use PdmOptionItemInfo constructor for PdmObjects
This commit is contained in:
@@ -79,10 +79,10 @@ QList<caf::PdmOptionItemInfo> RicLinkVisibleViewsFeatureUi::calculateValueOption
|
||||
|
||||
if (fieldNeedingOptions == &m_masterView)
|
||||
{
|
||||
for (size_t i = 0; i < m_allViews.size(); i++)
|
||||
for (RimView* v : m_allViews)
|
||||
{
|
||||
RimCase* rimCase = NULL;
|
||||
m_allViews[i]->firstAncestorOrThisOfType(rimCase);
|
||||
RimCase* rimCase = nullptr;
|
||||
v->firstAncestorOrThisOfType(rimCase);
|
||||
|
||||
QIcon icon;
|
||||
if (rimCase)
|
||||
@@ -90,11 +90,7 @@ QList<caf::PdmOptionItemInfo> RicLinkVisibleViewsFeatureUi::calculateValueOption
|
||||
icon = rimCase->uiCapability()->uiIcon();
|
||||
}
|
||||
|
||||
|
||||
optionList.push_back(caf::PdmOptionItemInfo(RimViewLinker::displayNameForView(m_allViews[i]),
|
||||
QVariant::fromValue(caf::PdmPointer<PdmObjectHandle>(m_allViews[i])),
|
||||
false,
|
||||
icon));
|
||||
optionList.push_back(caf::PdmOptionItemInfo(RimViewLinker::displayNameForView(v), v, false, icon));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "RimCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
@@ -45,34 +46,18 @@ RicChangeDataSourceFeatureUi::RicChangeDataSourceFeatureUi()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RicChangeDataSourceFeatureUi::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &caseToApply)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
for (RimCase* c : cases)
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c));
|
||||
}
|
||||
RimTools::caseOptionItems(&options);
|
||||
}
|
||||
else if (fieldNeedingOptions == &wellPathToApply)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
if (proj->activeOilField()->wellPathCollection())
|
||||
{
|
||||
for (RimWellPath* wellPath : proj->activeOilField()->wellPathCollection()->wellPaths)
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath));
|
||||
}
|
||||
}
|
||||
RimTools::wellPathOptionItems(&options);
|
||||
}
|
||||
|
||||
return optionList;
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user