[Qtstalker-cvs-commits] qtstalker/plugins/quote/CSV CSV.cpp, 1.69, 1.70
Brought to you by:
sstratos
From: David C. <xl...@us...> - 2008-02-19 03:34:36
|
Update of /cvsroot/qtstalker/qtstalker/plugins/quote/CSV In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32577/plugins/quote/CSV Modified Files: CSV.cpp Log Message: Improved error reporting. Index: CSV.cpp =================================================================== RCS file: /cvsroot/qtstalker/qtstalker/plugins/quote/CSV/CSV.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** CSV.cpp 18 Oct 2007 09:12:34 -0000 1.69 --- CSV.cpp 19 Feb 2008 03:34:26 -0000 1.70 *************** *** 254,257 **** --- 254,260 ---- } + int lineCount = 0; + QFileInfo fi(f); + QString fName = fi.fileName(); while(stream.atEnd() == 0) { *************** *** 261,268 **** QStringList l = QStringList::split(delim, s, FALSE); if (l.count() != fieldList.count()) { ! qDebug("CSV::parse:File fields (%i) != rule format (%i)", l.count(), fieldList.count()); ! QString ss = symbol + " - " + tr("File fields != rule format"); printStatusLogMessage(ss); continue; --- 264,275 ---- QStringList l = QStringList::split(delim, s, FALSE); + lineCount++; if (l.count() != fieldList.count()) { ! QString ss = QString().sprintf( ! "%s - %s - %s: %s Number of fields in file (%i) != rule format (%i)", ! fName.latin1(), symbol.latin1(), tr("Line").latin1(), ! QString::number(lineCount).latin1(), l.count(), fieldList.count() ! ); printStatusLogMessage(ss); continue; *************** *** 280,285 **** if (! dt.isValid()) { ! qDebug("CSV::parse: %s - Bad date %s", symbol.latin1(), l[fieldLoop].latin1()); ! QString ss = symbol + " - " + tr("Bad date"); printStatusLogMessage(ss); flag = TRUE; --- 287,294 ---- if (! dt.isValid()) { ! QString ss = QString().sprintf("%s - %s - %s: %s %s: %s", ! fName.latin1(), symbol.latin1(), tr("Line").latin1(), QString::number(lineCount).latin1(), ! tr("Bad date").latin1(), l[fieldLoop].latin1() ! ); printStatusLogMessage(ss); flag = TRUE; *************** *** 306,311 **** if (! s.length()) { ! qDebug("CSV::parse: %s - Bad time %s", symbol.latin1(), l[fieldLoop].latin1()); ! QString ss = symbol + " - " + tr("Bad time"); printStatusLogMessage(ss); flag = TRUE; --- 315,322 ---- if (! s.length()) { ! QString ss = QString().sprintf("%s - %s - %s: %s %s: %s", ! fName.latin1(), symbol.latin1(), tr("Line").latin1(), QString::number(lineCount).latin1(), ! tr("Bad time").latin1(), l[fieldLoop].latin1() ! ); printStatusLogMessage(ss); flag = TRUE; *************** *** 347,352 **** if (setTFloat(l[fieldLoop], TRUE)) { ! qDebug("CSV::parse: %s - Bad %s value", symbol.latin1(), fieldList[fieldLoop].latin1()); ! QString ss = symbol + " - " + tr("Bad value"); printStatusLogMessage(ss); flag = TRUE; --- 358,365 ---- if (setTFloat(l[fieldLoop], TRUE)) { ! QString ss = QString().sprintf("%s - %s - %s: %i %s: %s", ! fName.latin1(), symbol.latin1(), tr("Line").latin1(), lineCount, ! tr("Bad value").latin1(), tr(fieldList[fieldLoop]).latin1() ! ); printStatusLogMessage(ss); flag = TRUE; *************** *** 363,368 **** if (setTFloat(l[fieldLoop], FALSE)) { ! qDebug("CSV::parse: %s - Bad %s value", symbol.latin1(), fieldList[fieldLoop].latin1()); ! QString ss = symbol + " - " + tr("Bad value"); printStatusLogMessage(ss); flag = TRUE; --- 376,383 ---- if (setTFloat(l[fieldLoop], FALSE)) { ! QString ss = QString().sprintf("%s - %s - %s: %s %s: %s", ! fName.latin1(), symbol.latin1(), tr("Line").latin1(), QString::number(lineCount).latin1(), ! tr("Bad value").latin1(), tr(fieldList[fieldLoop]).latin1() ! ); printStatusLogMessage(ss); flag = TRUE; |