Changeset View
Changeset View
Standalone View
Standalone View
src/playlistgenerator/Preset.cpp
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 116 | void APG::Preset::queueSolver() { | |||
---|---|---|---|---|---|
124 | * obsolete jobs in the queue, and those that do run properly return | 124 | * obsolete jobs in the queue, and those that do run properly return | ||
125 | * obsolete results. So to avoid that problem, we avoid queueing the job | 125 | * obsolete results. So to avoid that problem, we avoid queueing the job | ||
126 | * until it's ready to run, and then the Weaver will start running it | 126 | * until it's ready to run, and then the Weaver will start running it | ||
127 | * pretty much immediately. -- sth */ | 127 | * pretty much immediately. -- sth */ | ||
128 | 128 | | |||
129 | emit lock( true ); | 129 | emit lock( true ); | ||
130 | 130 | | |||
131 | ConstraintSolver* s = static_cast<ConstraintSolver*>( sender() ); | 131 | ConstraintSolver* s = static_cast<ConstraintSolver*>( sender() ); | ||
132 | Amarok::Components::logger()->newProgressOperation( s, i18n("Generating a new playlist"), s->iterationCount(), s, SLOT(requestAbort()), Qt::QueuedConnection ); | 132 | Amarok::Components::logger()->newProgressOperation( s, i18n("Generating a new playlist"), s->iterationCount(), s, &ConstraintSolver::requestAbort, Qt::QueuedConnection ); | ||
133 | connect( s, &APG::ConstraintSolver::done, this, &Preset::solverFinished, Qt::QueuedConnection ); | 133 | connect( s, &APG::ConstraintSolver::done, this, &Preset::solverFinished, Qt::QueuedConnection ); | ||
134 | 134 | | |||
135 | m_constraintTreeRoot->addChild( ConstraintTypes::TrackSpreader::createNew( m_constraintTreeRoot ), 0 ); // private mandatory constraint | 135 | m_constraintTreeRoot->addChild( ConstraintTypes::TrackSpreader::createNew( m_constraintTreeRoot ), 0 ); // private mandatory constraint | ||
136 | 136 | | |||
137 | ThreadWeaver::Queue::instance()->enqueue( QSharedPointer<ThreadWeaver::Job>(s) ); | 137 | ThreadWeaver::Queue::instance()->enqueue( QSharedPointer<ThreadWeaver::Job>(s) ); | ||
138 | } | 138 | } | ||
139 | 139 | | |||
140 | void | 140 | void | ||
Show All 21 Lines |