#include "importproducer.h" ImportProducer::ImportProducer(QStringList fetchList, QList *buffer,QMutex *mutex) { this->buffer = buffer; this->fetchList = fetchList; this->mutex = mutex; } ImportProducer::~ImportProducer() { qDebug()<lock(); buffer->append(readList); emit bufferAppended(); mutex->unlock(); readList.clear(); } if(buffer->size()>10) { msleep(20); } } file.close(); } } void ImportProducer::fetchFromContent() { int pers = 1000; for(int i=0;ifetchList.size();i++) { QString content = this->fetchList.at(i); QTextStream in(&content); QStringList readList; int current_file_size=0; while (!in.atEnd()) { QString line = in.readLine(); current_file_size +=line.size(); readList.append(line); if( readList.size()%pers==0 || in.atEnd()) { emit produced(current_file_size); current_file_size = 0; mutex->lock(); buffer->append(readList); emit bufferAppended(); mutex->unlock(); readList.clear(); } } } } void ImportProducer::setBuildType(NumberBuildType buildType) { this->buildType = buildType; }