Commit db098ef8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaContainer: tweak log messages & simplify existence check

parent 124caf22
...@@ -81,11 +81,17 @@ Media* ...@@ -81,11 +81,17 @@ Media*
MediaContainer::addMedia( const QFileInfo& fileInfo ) MediaContainer::addMedia( const QFileInfo& fileInfo )
{ {
if ( QFile::exists( fileInfo.absoluteFilePath() ) == false ) if ( QFile::exists( fileInfo.absoluteFilePath() ) == false )
{
vlmcCritical() << "Can't add" << fileInfo.absoluteFilePath() << ": File not found";
return NULL; return NULL;
}
foreach( Clip* it, m_clips.values() ) foreach( Clip* it, m_clips.values() )
{ {
if ( it->getMedia()->fileInfo()->filePath() == fileInfo.filePath() ) if ( (*it->getMedia()->fileInfo()) == fileInfo )
{
vlmcWarning() << "Ignoring aleady imported media" << fileInfo.absolutePath();
return NULL; return NULL;
}
} }
Media* media = new Media( fileInfo.filePath() ); Media* media = new Media( fileInfo.filePath() );
return media; return media;
......
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