[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Peter Kümmel syntheticpp at gmx.net
Sun Oct 14 12:32:33 UTC 2012


SVN commit 1320496 by kuemmel:

FileBuffer doesn't store row numbers

 M  +6 -6      asciisource.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1320495:1320496
@@ -303,14 +303,14 @@
     return 0;
   }
   
-  int bufstart = reader.beginOfRow(s);
-  int bufread = reader.beginOfRow(s + n) - bufstart;
-  if (bufread <= 0) {
+  int begin = reader.beginOfRow(s);
+  int bytesToRead = reader.beginOfRow(s + n) - begin;
+  if (bytesToRead <= 0) {
     return 0;
   }
 
   // check if the already in buffer
-  if ((s != _fileBuffer->begin()) || (bufread != _fileBuffer->bytesRead())) {
+  if ((begin != _fileBuffer->begin()) || (bytesToRead != _fileBuffer->bytesRead())) {
     QFile file(_filename);
     if (!openValidFile(file)) {
       return 0;
@@ -318,8 +318,8 @@
     
     reader.detectLineEndingType(file);
     
-    bufread = _fileBuffer->read(file, bufstart, bufread);
-    if (bufread == 0) {
+    bytesToRead = _fileBuffer->read(file, begin, bytesToRead);
+    if (bytesToRead == 0) {
       success = false;
       return 0;
     }


More information about the Kst mailing list