Skip to content

Commit

Permalink
Output field keyword alias names
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Apr 17, 2020
1 parent 2d5d4e4 commit 3c05fff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "cafClassTypeName.h"
#include "cafPdmDefaultObjectFactory.h"
#include "cafPdmXmlFieldHandle.h"

#include <QAction>
#include <QApplication>
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ bool PdmFieldHandle::matchesKeywordAlias(const QString& keyword) const
return false;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> PdmFieldHandle::keywordAliases() const
{
return m_keywordAliases;
}

// These two functions can be used when PdmCore is used standalone without PdmUi/PdmXml
/*
PdmUiFieldHandle* PdmFieldHandle::uiCapability()
Expand Down
5 changes: 3 additions & 2 deletions Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString> keywordAliases() const;

// Child objects
bool hasChildObjects();
Expand Down

0 comments on commit 3c05fff

Please sign in to comment.