comparison data/fileio/CSVFileReader.cpp @ 1030:920699b6989d

Use filename as object name when reading data file to model (so it shows in the resulting layer name)
author Chris Cannam
date Fri, 13 Feb 2015 13:30:28 +0000
parents e369dd281cf2
children cc27f35aa75c
comparison
equal deleted inserted replaced
1029:1ecd533a9977 1030:920699b6989d
24 #include "model/RegionModel.h" 24 #include "model/RegionModel.h"
25 #include "model/NoteModel.h" 25 #include "model/NoteModel.h"
26 #include "DataFileReaderFactory.h" 26 #include "DataFileReaderFactory.h"
27 27
28 #include <QFile> 28 #include <QFile>
29 #include <QFileInfo>
29 #include <QString> 30 #include <QString>
30 #include <QRegExp> 31 #include <QRegExp>
31 #include <QStringList> 32 #include <QStringList>
32 #include <QTextStream> 33 #include <QTextStream>
33 34
53 good = true; 54 good = true;
54 } 55 }
55 56
56 if (good) { 57 if (good) {
57 m_device = file; 58 m_device = file;
59 m_filename = QFileInfo(path).fileName();
58 } else { 60 } else {
59 delete file; 61 delete file;
60 } 62 }
61 } 63 }
62 64
260 windowSize, 262 windowSize,
261 valueColumns, 263 valueColumns,
262 EditableDenseThreeDimensionalModel::NoCompression); 264 EditableDenseThreeDimensionalModel::NoCompression);
263 model = model3; 265 model = model3;
264 break; 266 break;
267 }
268
269 if (model) {
270 if (m_filename != "") {
271 model->setObjectName(m_filename);
272 }
265 } 273 }
266 } 274 }
267 275
268 float value = 0.f; 276 float value = 0.f;
269 float pitch = 0.f; 277 float pitch = 0.f;