Commit 73cfb7e8 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Library: Removed old and useless method getElementByUuid.

We don't need this anymore as Clip aren't stored in the Library.
parent 543e5010
......@@ -47,7 +47,10 @@ Library::Library()
Media*
Library::media( const QUuid& uuid )
{
return getElementByUuid( m_medias, uuid );
QHash<QUuid, Media*>::const_iterator it = m_medias.find( uuid );
if ( it == m_medias.end() )
return NULL;
return *it;
}
Clip*
......@@ -67,7 +70,7 @@ Library::clip( const QUuid& uuid )
{
Media* media = m_medias.value( mediaUuid );
if ( media != NULL && media->clips()->contains( uuid ) )
return getElementByUuid( *media->clips(), uuid );
return media->clip( uuid );
}
return NULL;
}
......
......@@ -123,20 +123,6 @@ private:
* \brief The List of medias loaded into the library
*/
QHash<QUuid, Media*> m_medias;
/**
* \brief This method allows to get whereas Media or clip by uuid
* \param container The type of container used for storage, where T is Clip or Media
* \param uuid The uuid of the element you are looking for
*/
template <typename T>
T getElementByUuid( const QHash<QUuid, T>& container ,
const QUuid& uuid )
{
typename QHash<QUuid, T>::const_iterator it = container.find( uuid );
if ( it == container.end() )
return NULL;
return *it;
}
public slots:
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment