1
/***************************************************************************
2
rkjobsequence - description
5
copyright : (C) 2010 by Thomas Friedrichsmeier
6
email : tfry@users.sourceforge.net
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
17
#include "rkjobsequence.h"
21
RKJobSequence::RKJobSequence () : QObject () {
25
RKJobSequence::~RKJobSequence () {
29
void RKJobSequence::addJob (KJob* job) {
32
outstanding_jobs.append (job);
33
connect (job, SIGNAL (result(KJob*)), this, SLOT(jobDone(KJob*)));
36
bool RKJobSequence::hadError () const {
39
return (!_errors.isEmpty ());
42
QStringList RKJobSequence::errors () const {
48
void RKJobSequence::start () {
54
void RKJobSequence::nextJob () {
57
if (outstanding_jobs.isEmpty ()) {
58
emit (finished (this));
63
outstanding_jobs.first ()->start ();
66
void RKJobSequence::jobDone (KJob* job) {
69
outstanding_jobs.removeAll (job);
71
_errors.append (job->errorString ());
76
#include "rkjobsequence.moc"