TreeModel::TreeModel( QObject* parent ) : QAbstractItemModel( parent ) , m_rootItem( new TreeModelItem( downloadjob_ptr(), 0, this ) ) { addJobs( DownloadManager::instance()->jobs() ); connect( DownloadManager::instance(), SIGNAL( jobAdded( downloadjob_ptr ) ), SLOT( onJobAdded( downloadjob_ptr ) ) ); }
void FractalGenerator::handleState() { if ( m_activeJobs > 0 || !m_enabled || m_pendingResolution.isEmpty() ) return; if ( !m_regions.isEmpty() && !m_pending ) { addJobs(); return; } if ( m_preview && m_buffer && m_regions.isEmpty() && m_resolution == m_pendingResolution ) { delete[] m_previewBuffer; m_previewBuffer = m_buffer; m_buffer = NULL; postUpdate( FullUpdate ); } if ( m_pending ) { if ( m_buffer && m_bufferSize != m_pendingBufferSize ) { delete[] m_buffer; m_buffer = NULL; } m_type = m_pendingType; m_position = m_pendingPosition; m_settings = m_pendingSettings; m_resolution = m_pendingResolution; m_bufferSize = m_pendingBufferSize; m_pending = false; if ( !m_buffer ) m_buffer = new double[ m_bufferSize.width() * m_bufferSize.height() ]; createFunctor(); if ( !m_preview ) postUpdate( InitialUpdate ); m_validRegions.clear(); splitRegions(); addJobs(); } }
/************************************************ * * ***********************************************/ void Project::addJob(Job job) { addJobs(JobList() << job); }