#903 Fixed formation names file name presentation in UI. Use filename wo/path

This commit is contained in:
Jacob Støren 2016-10-05 15:41:10 +02:00
parent 58a25c9fe9
commit a9509c0212
3 changed files with 15 additions and 3 deletions

View File

@ -78,7 +78,7 @@ QList<caf::PdmOptionItemInfo> RimCase::calculateValueOptions(const caf::PdmField
{
for(RimFormationNames* fnames : proj->activeOilField()->formationNamesCollection()->formationNamesList())
{
optionList.push_back(caf::PdmOptionItemInfo(fnames->uiCapability()->uiName(),
optionList.push_back(caf::PdmOptionItemInfo(fnames->fileNameWoPath(),
QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(fnames)),
false,
fnames->uiCapability()->uiIcon()));

View File

@ -25,7 +25,9 @@
#include "RimView.h"
#include "cafPdmUiFilePathEditor.h"
#include "QFile"
#include <QFile>
#include <QFileInfo>
CAF_PDM_SOURCE_INIT(RimFormationNames, "FormationNames");
@ -76,7 +78,7 @@ void RimFormationNames::initAfterRead()
//--------------------------------------------------------------------------------------------------
void RimFormationNames::updateUiTreeName()
{
this->uiCapability()->setUiName(m_formationNamesFileName());
this->uiCapability()->setUiName(fileNameWoPath());
}
//--------------------------------------------------------------------------------------------------
@ -97,6 +99,15 @@ const QString& RimFormationNames::fileName()
return m_formationNamesFileName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFormationNames::fileNameWoPath()
{
QFileInfo fnameFileInfo(m_formationNamesFileName());
return fnameFileInfo.fileName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -33,6 +33,7 @@ public:
void setFileName(const QString& fileName);
const QString& fileName();
QString fileNameWoPath();
RigFormationNames* formationNamesData() { return m_formationNamesData.p();}
void updateConnectedViews();