changeset 1119:e22bfe8ca248 tonioni

fixes the problem that the last note was not exported to csv
author Matthias Mauch <mail@matthiasmauch.net>
date Fri, 14 Aug 2015 18:16:14 +0100
parents 135c5899a71f
children 39019ce29178
files data/fileio/CSVFileReader.cpp data/fileio/CSVFileReader.h data/fileio/CSVFileWriter.cpp data/model/SparseModel.h
diffstat 4 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/CSVFileReader.cpp	Mon Apr 13 13:52:05 2015 +0100
+++ b/data/fileio/CSVFileReader.cpp	Fri Aug 14 18:16:14 2015 +0100
@@ -31,6 +31,7 @@
 #include <QRegExp>
 #include <QStringList>
 #include <QTextStream>
+#include <QIODevice>
 
 #include <iostream>
 #include <map>
--- a/data/fileio/CSVFileReader.h	Mon Apr 13 13:52:05 2015 +0100
+++ b/data/fileio/CSVFileReader.h	Fri Aug 14 18:16:14 2015 +0100
@@ -26,6 +26,7 @@
 #include <QStringList>
 
 class QFile;
+class QIODevice;
 
 class CSVFileReader : public DataFileReader
 {
--- a/data/fileio/CSVFileWriter.cpp	Mon Apr 13 13:52:05 2015 +0100
+++ b/data/fileio/CSVFileWriter.cpp	Fri Aug 14 18:16:14 2015 +0100
@@ -68,7 +68,7 @@
                 .arg(temp.getTemporaryFilename());
             return;
         }
-    
+
         QTextStream out(&file);
         out << m_model->toDelimitedDataStringWithOptions
             (m_delimiter, m_options);
--- a/data/model/SparseModel.h	Mon Apr 13 13:52:05 2015 +0100
+++ b/data/model/SparseModel.h	Fri Aug 14 18:16:14 2015 +0100
@@ -173,7 +173,7 @@
         } else {
             QString s;
             for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) {
-                if (i->frame >= f0 && i->frame < f1) {
+                if (i->frame >= f0 && i->frame <= f1) {
                     s += i->toDelimitedDataString(delimiter, opts, m_sampleRate) + "\n";
                 }
             }
@@ -551,8 +551,8 @@
     QMutexLocker locker(&m_mutex);
     sv_frame_t f = 0;
     if (!m_points.empty()) {
-	PointListConstIterator i(m_points.end());
-	f = (--i)->frame;
+	   PointListConstIterator i(m_points.end());
+	   f = (--i)->frame;
     }
     if (m_extendTo > f) return m_extendTo;
     else return f;