#include "analyse_subtitles_job.h"
#include "film.h"
#include <boost/thread.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
{
boost::this_thread::disable_interruption dis;
- BOOST_FOREACH (boost::signals2::connection& i, _connections) {
+ for (auto& i: _connections) {
i.disconnect ();
}
JobManager::errors () const
{
boost::mutex::scoped_lock lm (_mutex);
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (i->finished_in_error ()) {
return true;
}
while (true) {
bool have_new = false;
bool have_running = false;
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (i->running()) {
have_running = true;
}
break;
}
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (i->is_new()) {
_connections.push_back (i->FinishedImmediate.connect(bind(&JobManager::job_finished, this)));
i->start ();
{
boost::mutex::scoped_lock lm (_mutex);
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
shared_ptr<AnalyseAudioJob> a = dynamic_pointer_cast<AnalyseAudioJob> (i);
if (a && a->path() == film->audio_analysis_path(playlist) && !i->finished_cancelled()) {
i->when_finished (connection, ready);
{
boost::mutex::scoped_lock lm (_mutex);
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
shared_ptr<AnalyseSubtitlesJob> a = dynamic_pointer_cast<AnalyseSubtitlesJob> (i);
if (a && a->path() == film->subtitle_analysis_path(content)) {
i->when_finished (connection, ready);
boost::mutex::scoped_lock lm (_mutex);
bool first = true;
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (first) {
if (i->is_new ()) {
i->start ();
return;
}
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (i->pause_by_user()) {
_paused_job = i;
}