From 3c05fff768a4cc7fe5e42f4a998fc7d9dff7f031 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 17 Apr 2020 13:55:49 +0200 Subject: [PATCH] Output field keyword alias names --- .../RicExportObjectAndFieldKeywordsFeature.cpp | 8 ++++++++ .../cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.cpp | 8 ++++++++ .../cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h | 5 +++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Commands/ApplicationCommands/RicExportObjectAndFieldKeywordsFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicExportObjectAndFieldKeywordsFeature.cpp index 7447ebcb30..4c2d70a272 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicExportObjectAndFieldKeywordsFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicExportObjectAndFieldKeywordsFeature.cpp @@ -24,6 +24,7 @@ #include "cafClassTypeName.h" #include "cafPdmDefaultObjectFactory.h" +#include "cafPdmXmlFieldHandle.h" #include #include @@ -122,7 +123,14 @@ void RicExportObjectAndFieldKeywordsFeature::exportObjectAndFieldKeywords( const for ( auto f : fields ) { + if ( !f->xmlCapability()->isIOReadable() ) continue; + stream << " " << f->keyword() << "\n"; + + for ( auto alias : f->keywordAliases() ) + { + stream << " (A)" << alias << "\n"; + } } stream << "\n"; diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.cpp index 7b237d0ff1..0661a8f6cf 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.cpp @@ -124,6 +124,14 @@ bool PdmFieldHandle::matchesKeywordAlias(const QString& keyword) const return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector PdmFieldHandle::keywordAliases() const +{ + return m_keywordAliases; +} + // These two functions can be used when PdmCore is used standalone without PdmUi/PdmXml /* PdmUiFieldHandle* PdmFieldHandle::uiCapability() diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h index aa1293769e..86b8530012 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h @@ -27,8 +27,9 @@ class PdmFieldHandle PdmObjectHandle* ownerObject(); QString ownerClass() const; - void registerKeywordAlias(const QString& alias); - bool matchesKeywordAlias(const QString& keyword) const; + void registerKeywordAlias(const QString& alias); + bool matchesKeywordAlias(const QString& keyword) const; + std::vector keywordAliases() const; // Child objects bool hasChildObjects();