Skip to content

Commit

Permalink
Rename and improve log message
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Mar 1, 2024
1 parent 5be1610 commit 45a57c4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,6 @@ void RimPolygon::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEd

if ( m_isReadOnly )
{
caf::PdmUiTreeViewItemAttribute::createTagIfTreeViewItemAttribute( attribute, ":/padlock.svg" );
caf::PdmUiTreeViewItemAttribute::appendTagToTreeViewItemAttribute( attribute, ":/padlock.svg" );
}
}
23 changes: 10 additions & 13 deletions ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ void RimPolygonFile::loadData()
m_polygons.deleteChildren();

m_polygons.setValue( polygonsFromFile );
}

if ( polygonsFromFile.empty() )
{
RiaLogging::warning( "No polygons found in file: " + m_fileName().path() );
}
else
{
RiaLogging::warning( QString( "Imported %1 polygons from file: " ).arg( polygonsFromFile.size() ) + m_fileName().path() );
}
if ( polygonsFromFile.empty() )
{
RiaLogging::warning( "No polygons found in file: " + m_fileName().path() );
}
else
{
RiaLogging::info( QString( "Imported %1 polygons from file: " ).arg( polygonsFromFile.size() ) + m_fileName().path() );
}
}

Expand Down Expand Up @@ -197,11 +197,8 @@ void RimPolygonFile::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder )
//--------------------------------------------------------------------------------------------------
void RimPolygonFile::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute ) )
if ( m_polygons.empty() )
{
if ( m_polygons.empty() )
{
caf::PdmUiTreeViewItemAttribute::createTagIfTreeViewItemAttribute( attribute, ":/warning.svg" );
}
caf::PdmUiTreeViewItemAttribute::appendTagToTreeViewItemAttribute( attribute, ":/warning.svg" );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void RimPolygonInView::defineObjectEditorAttribute( QString uiConfigName, caf::P

if ( m_polygon->isReadOnly() )
{
caf::PdmUiTreeViewItemAttribute::createTagIfTreeViewItemAttribute( attribute, ":/padlock.svg" );
caf::PdmUiTreeViewItemAttribute::appendTagToTreeViewItemAttribute( attribute, ":/padlock.svg" );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Fwk/AppFwk/cafUserInterface/cafPdmUiTreeAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::unique_ptr<caf::PdmUiTreeViewItemAttribute::Tag>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::PdmUiTreeViewItemAttribute::createTagIfTreeViewItemAttribute( caf::PdmUiEditorAttribute* attribute,
void caf::PdmUiTreeViewItemAttribute::appendTagToTreeViewItemAttribute( caf::PdmUiEditorAttribute* attribute,
const QString& iconResourceString )
{
if ( auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute ) )
Expand Down
2 changes: 1 addition & 1 deletion Fwk/AppFwk/cafUserInterface/cafPdmUiTreeAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class PdmUiTreeViewItemAttribute : public PdmUiEditorAttribute

static std::unique_ptr<Tag> createTag();
static std::unique_ptr<Tag> createTag( const QColor& color, const QColor& backgroundColor, const QString& text );
static void createTagIfTreeViewItemAttribute( caf::PdmUiEditorAttribute* attribute, const QString& iconString );
static void appendTagToTreeViewItemAttribute( caf::PdmUiEditorAttribute* attribute, const QString& iconString );

std::vector<std::unique_ptr<Tag>> tags;
};
Expand Down

0 comments on commit 45a57c4

Please sign in to comment.