void WorkerThread::setImagesList(const KUrl::List& list) { pd->urls = list; JobCollection* collection = new JobCollection(this); for (KUrl::List::const_iterator it = pd->urls.constBegin(); it != pd->urls.constEnd(); ++it) { Task *t = new Task((KUrl&)(*it), this, pd); connect(t, SIGNAL(calculationFinished(WorkerThreadData*)), this, SIGNAL(calculationFinished(WorkerThreadData*))); collection->addJob(t); } appendJob(collection); pd->cancel = false; pd->progress = 0; }
void ActionThread::convert2grayscale(const KUrl::List& urlList) { JobCollection* collection = new JobCollection(); for (KUrl::List::const_iterator it = urlList.constBegin(); it != urlList.constEnd(); ++it ) { ActionThread::Task* t = new Task(this); t->fileUrl = *it; t->action = GrayScale; connect(t, SIGNAL(started(ThreadWeaver::Job*)), this, SLOT(slotJobStarted(ThreadWeaver::Job*))); connect(t, SIGNAL(done(ThreadWeaver::Job*)), this, SLOT(slotJobDone(ThreadWeaver::Job*))); collection->addJob(t); } appendJob(collection); }