Commit 1ca51b48 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

DiscovererWorker: Remove setCallback method

parent 0a4121dd
......@@ -481,8 +481,7 @@ void MediaLibrary::startParser()
void MediaLibrary::startDiscoverer()
{
m_discoverer.reset( new DiscovererWorker );
m_discoverer->setCallback( m_callback );
m_discoverer.reset( new DiscovererWorker( this ) );
m_discoverer->addDiscoverer( std::unique_ptr<IDiscoverer>( new FsDiscoverer( m_fsFactory, this ) ) );
m_discoverer->reload();
}
......
......@@ -23,10 +23,11 @@
#include "DiscovererWorker.h"
#include "logging/Logger.h"
#include "MediaLibrary.h"
DiscovererWorker::DiscovererWorker()
DiscovererWorker::DiscovererWorker( MediaLibraryPtr ml )
: m_run( false )
, m_cb( nullptr )
, m_cb( ml->getCb() )
{
}
......@@ -40,11 +41,6 @@ void DiscovererWorker::addDiscoverer( std::unique_ptr<IDiscoverer> discoverer )
m_discoverers.push_back( std::move( discoverer ) );
}
void DiscovererWorker::setCallback(IMediaLibraryCb* cb)
{
m_cb = cb;
}
void DiscovererWorker::stop()
{
bool running = true;
......
......@@ -36,10 +36,9 @@
class DiscovererWorker : public IDiscoverer
{
public:
DiscovererWorker();
DiscovererWorker( MediaLibraryPtr ml );
virtual ~DiscovererWorker();
void addDiscoverer( std::unique_ptr<IDiscoverer> discoverer );
void setCallback( IMediaLibraryCb* cb );
void stop();
virtual bool discover( const std::string& entryPoint ) override;
......
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