/*******************************************************************************
 Class ThreadManager
*******************************************************************************/
ThreadManager::ThreadManager(QObject* parent): QObject(parent)
{
  INSTANCE = this;
  m_threadPool = new QThreadPool(this);

  // Qrunnable
  m_databaseBuilder = new DataBaseBuilder();
  m_databaseBuilder->setAutoDelete(false);

  // QThread
  //    m_collectionPopulator = new CollectionPopulator();
  m_coverThread = 0;
  m_fanartThread = 0;

  // PFC
  m_PFCGenerator = 0;

  // connection
  QObject::connect(m_databaseBuilder,SIGNAL(buildingFinished()),this,SLOT(dbBuildFinish()));
  QObject::connect(m_databaseBuilder,SIGNAL(buildingProgress(int)),this,SLOT(dbBuildProgressChanged(int)));
  QObject::connect(m_databaseBuilder,SIGNAL(buildingProgress(int)),this,SIGNAL(dbBuildProgress(int)));

  //    QObject::connect(m_collectionPopulator,SIGNAL(populatingFinished()),this,SLOT(modelCollectionPopulated()));
  //    QObject::connect(m_collectionPopulator,SIGNAL(populatingProgress(int)),this,SLOT(modelCollectionPopulatingChanged(int)));
  //    QObject::connect(m_collectionPopulator, SIGNAL(populatingRunning()), this,SLOT(modelCollectionPopulatingRunning()));
}
Exemplo n.º 2
0
/*
********************************************************************************
*                                                                              *
*    Class ThreadManager                                                       *
*                                                                              *
********************************************************************************
*/
ThreadManager::ThreadManager()
{
    INSTANCE = this;

    // QThread
    m_databaseBuilder         = new DataBaseBuilder();
    m_localTrackPopulator     = new LocalTrackPopulator();
    m_localPlaylistPopulator  = new LocalPlaylistPopulator();
    m_coverTask               = 0;

    // connection
    QObject::connect(m_databaseBuilder,SIGNAL(buildingFinished()),this,SLOT(dbBuildFinish()));
    QObject::connect(m_databaseBuilder,SIGNAL(buildingProgress(int)),this,SLOT(dbBuildProgressChanged(int)));

    QObject::connect(m_localTrackPopulator,SIGNAL(populatingFinished()),this,SLOT(slot_on_localtrackmodel_populated()));
    QObject::connect(m_localTrackPopulator,SIGNAL(populatingProgress(int)),this,SLOT(slot_on_localtrackmodel_populating_changed(int)));

    QObject::connect(m_localPlaylistPopulator,SIGNAL(populatingFinished()),this,SLOT(slot_on_localplaylistmodel_populated()));
    QObject::connect(m_localPlaylistPopulator,SIGNAL(populatingProgress(int)),this,SLOT(slot_on_localplaylistmodel_populating_changed(int)));
}