bool get(RowBuffer & buffer) { if(eof) return false; if(buffer.getCursorNext(keyCursor)) { buffer.tally(crc); count++; checkProgress(); return true; } eof = true; checkProgress(); return false; }
void SubRequestBin::checkProgress(qint64 _cur, qint64 _tot) { if(_cur > 0.5*1024*1024) { disconnect(netReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkProgress(qint64,qint64))); specificBinHandler(buf); } }
void SubRequestBin::specificHandler() { buf = new QBuffer(); buf->open(QIODevice::ReadWrite); connect(netReply, SIGNAL(readyRead()), this, SLOT(writeToBuffer())); connect(netReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkProgress(qint64,qint64))); connect(netReply, SIGNAL(finished()), this, SLOT(finishedDownloading())); }
/*** PUBLIC ***/ br::Progress::Progress(QWidget *parent) : QStatusBar(parent) { pbProgress.setVisible(false); pbProgress.setMaximum(100); pbProgress.setMinimum(0); pbProgress.setValue(0); pbProgress.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); pbProgress.setTextVisible(false); addWidget(&wSpacer, 1); addPermanentWidget(&pbProgress); addPermanentWidget(&lTimeRemaining); connect(&timer, SIGNAL(timeout()), this, SLOT(checkProgress())); timer.start(1000); }