Commit a2016025 authored by Geoffroy Lacarriere's avatar Geoffroy Lacarriere

clicking the Cancel button when metadata computing doesn't crash anymore

parent d1c990a3
......@@ -54,7 +54,14 @@ void ImportMediaListController::metaDataComputed( Media* media )
ImportMediaCellView* ImportMediaListController::getCell( QUuid uuid ) const
{
return m_mediaCellList->value( uuid );
if (m_mediaCellList->contains( uuid ) )
return m_mediaCellList->value( uuid );
return NULL;
}
bool ImportMediaListController::contains( QUuid uuid )
{
return m_mediaCellList->contains( uuid );
}
void ImportMediaListController::removeMedia( const QUuid& uuid )
......
......@@ -46,6 +46,7 @@ class ImportMediaListController : public ListViewController
const QHash<QUuid, ImportMediaCellView*>* getMediaCellList() const { return m_mediaCellList; }
ImportMediaCellView* getCell( QUuid uuid ) const;
bool contains( QUuid uuid );
private:
StackViewController* m_nav;
......
......@@ -205,6 +205,12 @@ void Media::emitSnapshotComputed()
emit snapshotComputed( this );
}
void Media::emitAudioSpectrumComuted()
{
m_metadataState = ParsedWithAudioSpectrum;
emit audioSpectrumComputed( this );
}
Media::InputType Media::getInputType() const
{
return m_inputType;
......
......@@ -69,7 +69,8 @@ public:
{
None,
ParsedWithoutSnapshot,
ParsedWithSnapshot
ParsedWithSnapshot,
ParsedWithAudioSpectrum
};
Media( const QString& filePath, const QString& uuid = QString() );
virtual ~Media();
......@@ -133,6 +134,7 @@ public:
void emitMetaDataComputed( bool hasMetadata );
void emitSnapshotComputed();
void emitAudioSpectrumComuted();
// bool hasMetadata() const;
MetadataState getMetadata() const;
......
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