# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2018-03-29 17:23:28 # Node ID 06e596e43cde7951f539bb376f6c966c50ad7686 # Parent 452acca9be28efdbb163ba8d7bf93d732e9986ff fix issue #15 snapshots not loading completely in some cases I think this is a buffering issue caused by use of QFile.canReadLine function. Note that loaded portion of the file was approximately 16k. diff --git a/src/snapshotmanager.cpp b/src/snapshotmanager.cpp --- a/src/snapshotmanager.cpp +++ b/src/snapshotmanager.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -159,17 +160,19 @@ void SnapshotManager::loadSnapshotFromFi // read data QVector> data(numOfChannels); + QTextStream ts(&file); + QString line; unsigned lineNum = 1; - while (file.canReadLine()) + while (ts.readLineInto(&line)) { // parse line - auto line = QString(file.readLine()); auto split = line.split(','); if (split.size() != (int) numOfChannels) { qCritical() << "Parsing error at line " << lineNum << ": number of columns is not consistent."; + qCritical() << "Line " << lineNum << ": " << line; return; }