Commit 9534b257 authored by Christophe Courtaut's avatar Christophe Courtaut

Don't spawn a thread to compute metadata

parent 2766361e
......@@ -78,7 +78,7 @@ void ImportModel::loadMedia( Media* media )
emit newMediaLoaded( media );
connect( media, SIGNAL( metaDataComputed( Media* ) ), this, SLOT( metaDataComputed( Media* ) ) );
m_metaDataWorker = new MetaDataWorker( media );
m_metaDataWorker->start();
m_metaDataWorker->compute();
}
bool ImportModel::mediaAlreadyLoaded( const QFileInfo& fileInfo )
......
......@@ -39,6 +39,6 @@ void MetaDataManager::metadataRequired( Media* media )
if ( media->hasMetadata() == false )
{
MetaDataWorker* w = new MetaDataWorker( media );
w->start();
w->compute();
}
}
......@@ -40,7 +40,7 @@ MetaDataWorker::~MetaDataWorker()
delete m_mediaPlayer;
}
void MetaDataWorker::run()
void MetaDataWorker::compute()
{
if ( m_currentMedia->getFileType() == Media::Video )
{
......
......@@ -31,7 +31,7 @@
#include "Media.h"
#include "VLCMediaPlayer.h"
class MetaDataWorker : public QThread
class MetaDataWorker : public QObject
{
Q_OBJECT
Q_DISABLE_COPY( MetaDataWorker )
......@@ -39,7 +39,7 @@ class MetaDataWorker : public QThread
public:
MetaDataWorker( Media* media );
~MetaDataWorker();
virtual void run();
void compute();
private:
void computeVideoMetaData();
......
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