comparison data/fileio/CSVFileReader.cpp @ 1509:3299b42d8bdd import-audio-data

Don't try to continue after what should have been a terminal problem
author Chris Cannam
date Wed, 05 Sep 2018 11:56:39 +0100
parents b837ccdd4946
children 925d205c39b4
comparison
equal deleted inserted replaced
1508:b837ccdd4946 1509:3299b42d8bdd
227 if (m_format.getColumnPurpose(i) == CSVFormat::ColumnValue) { 227 if (m_format.getColumnPurpose(i) == CSVFormat::ColumnValue) {
228 ++valueColumns; 228 ++valueColumns;
229 } 229 }
230 } 230 }
231 231
232 while (!in.atEnd()) { 232 bool abandoned = false;
233
234 while (!in.atEnd() && !abandoned) {
233 235
234 // QTextStream's readLine doesn't cope with old-style Mac 236 // QTextStream's readLine doesn't cope with old-style Mac
235 // CR-only line endings. Why did they bother making the class 237 // CR-only line endings. Why did they bother making the class
236 // cope with more than one sort of line ending, if it still 238 // cope with more than one sort of line ending, if it still
237 // can't be configured to cope with all the common sorts? 239 // can't be configured to cope with all the common sorts?
247 249
248 m_readCount += chunk.size() + 1; 250 m_readCount += chunk.size() + 1;
249 251
250 if (m_reporter) { 252 if (m_reporter) {
251 if (m_reporter->wasCancelled()) { 253 if (m_reporter->wasCancelled()) {
254 abandoned = true;
252 break; 255 break;
253 } 256 }
254 int progress; 257 int progress;
255 if (m_fileSize > 0) { 258 if (m_fileSize > 0) {
256 progress = int((double(m_readCount) / double(m_fileSize)) 259 progress = int((double(m_readCount) / double(m_fileSize))
325 delete model; 328 delete model;
326 model = 0; 329 model = 0;
327 model1 = 0; model2 = 0; model2a = 0; model2b = 0; 330 model1 = 0; model2 = 0; model2a = 0; model2b = 0;
328 model3 = 0; modelW = 0; 331 model3 = 0; modelW = 0;
329 } 332 }
333 abandoned = true;
330 break; 334 break;
331 } 335 }
332 336
333 float value = 0.f; 337 float value = 0.f;
334 float pitch = 0.f; 338 float pitch = 0.f;