diff --git a/include/ResourceDB.h b/include/ResourceDB.h index 402b02835..09ede443f 100644 --- a/include/ResourceDB.h +++ b/include/ResourceDB.h @@ -69,6 +69,7 @@ public: return &m_topLevelNode; } + const ResourceItem * itemByHash( const QString & _hash ) const; const ResourceItem * nearestMatch( const ResourceItem & _item ); void addItem( ResourceItem * newItem ); diff --git a/src/core/ResourceDB.cpp b/src/core/ResourceDB.cpp index 0495d1197..7fb14f960 100644 --- a/src/core/ResourceDB.cpp +++ b/src/core/ResourceDB.cpp @@ -188,6 +188,19 @@ loadTreeItem( treeItem, e ); +const ResourceItem * ResourceDB::itemByHash( const QString & _hash ) const +{ + ItemList::ConstIterator it = m_items.find( _hash ); + if( it != m_items.end() ) + { + return it.value(); + } + return NULL; +} + + + + const ResourceItem * ResourceDB::nearestMatch( const ResourceItem & _item ) { if( !_item.hash().isEmpty() )