Job::Job(Job& clone) { priority = clone.priority; jobName = clone.jobName; fileName = clone.fileName; jobID = clone.jobID; start=clone.start; finish=clone.finish; WorkItem* tempOld; //deep copy unassigned QPtrList tempOld = clone.unassigned.first(); while(tempOld) { unassigned.append(new WorkItem(this,tempOld->getFrameInfo())); tempOld = clone.unassigned.next(); } //deep copy working QPtrList tempOld = clone.working.first(); while(tempOld) { working.append(new WorkItem(this,tempOld->getFrameInfo())); tempOld = clone.working.next(); } //deep copy finished QPtrList tempOld = clone.finished.first(); while(tempOld) { finished.append(new WorkItem(this,tempOld->getFrameInfo())); tempOld = clone.finished.next(); } finished.setAutoDelete(true); working.setAutoDelete(true); unassigned.setAutoDelete(true); }
bool Job::inList(Que* list, QString itemInfo) { if(list) { //traverse list from front WorkItem* listWalker = list->first(); while(listWalker) { //return true if ID matches if(listWalker->getFrameInfo() == itemInfo) return true; listWalker = list->next(); } } //did not find matching ID in list return false; }