qfilereader.cpp
Go to the documentation of this file.
00001 #include "qfilereader.h"
00002 #include "qfilereader.moc"
00003 
00004 QFileReader::QFileReader(QIODevice * source) :
00005         source(source) {
00006 
00007 }
00008         
00009 void QFileReader::run() {
00010         printf("Running\n");
00011                 
00012         while(1) {
00013                 char buf[10024];
00014                 qint64 lineLength = source->readLine(buf, sizeof(buf));
00015                 if (lineLength == -1) break;
00016                 emit new_line(QString(buf));
00017                 
00018 /*              source->waitForBytesWritten(-1);
00019                 if(source->canReadLine()) {
00020                         printf("can\n");
00021                         QByteArray data = source->readLine();
00022                         emit new_line(QString(data));
00023                 } else {
00024                         printf(".");
00025                 }*/
00026         }
00027         
00028         emit eof();
00029 }
00030 


csm
Author(s): Andrea Censi
autogenerated on Mon Jan 16 2017 03:48:29