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

MediaContainer: Renamed removeClip to deleteClip

It actually delete the removed clip. This is mainly used as a SLOT, therefore, returning something was stupid.
parent a7fa3cb2
......@@ -328,7 +328,7 @@ ImportController::failedToLoad( Media *media )
m_ui->errorLabelImg->show();
m_ui->errorLabel->show();
QTimer::singleShot( 3000, this, SLOT( hideErrors() ) );
delete m_temporaryMedias->removeClip( media->baseClip()->uuid() );
m_temporaryMedias->deleteClip( media->baseClip()->uuid() );
}
void
......
......@@ -35,7 +35,7 @@ MediaListView::MediaListView( StackViewController* nav, MediaContainer* mc ) :
connect( mc, SIGNAL( newClipLoaded(Clip*) ),
this, SLOT( newClipLoaded( Clip* ) ) );
connect( this, SIGNAL( clipRemoved( const QUuid& ) ),
mc, SLOT( removeClip( const QUuid& ) ) );
mc, SLOT( deleteClip( const QUuid& ) ) );
connect( mc, SIGNAL( clipRemoved( const QUuid& ) ),
this, SLOT( __clipRemoved( const QUuid& ) ) );
connect( mc, SIGNAL( destroyed() ), this, SLOT( deleteLater() ) );
......
......@@ -25,6 +25,7 @@
#include <QUuid>
#include "Clip.h"
#include "Library.h"
#include "MediaContainer.h"
#include "Media.h"
#include "MetaDataManager.h"
......@@ -149,8 +150,8 @@ MediaContainer::removeAll()
m_clips.clear();
}
Clip*
MediaContainer::removeClip( const QUuid &uuid )
void
MediaContainer::deleteClip( const QUuid &uuid )
{
QHash<QUuid, Clip*>::iterator it = m_clips.find( uuid );
if ( it != m_clips.end() )
......@@ -158,9 +159,8 @@ MediaContainer::removeClip( const QUuid &uuid )
Clip* clip = it.value();
m_clips.remove( uuid );
emit clipRemoved( uuid );
return clip;
delete clip;
}
return NULL;
}
const QHash<QUuid, Clip*>&
......
......@@ -91,7 +91,7 @@ public:
* \param clip The clip to be added.
* \return true if the Clip has been added.
*/
bool addClip( Clip* clip );
virtual bool addClip( Clip* clip );
/**
* \brief Save the contained media to the given XML stream
......@@ -131,10 +131,11 @@ protected:
public slots:
/**
* \brief Delete a Clip from the container
* \brief Removes a Clip from the container and delete it
*
* \param uuid The clip to remove's uuid.
*/
Clip *removeClip( const QUuid& uuid );
void deleteClip( const QUuid& uuid );
/**
* \brief Clear the library (remove all the loaded Clip, delete their subclips, and
* delete them)
......
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