From a9ddd40ddab18a3c9996d3f845cfc77a8d92d3f0 Mon Sep 17 00:00:00 2001 From: Sean Rhea Date: Sat, 7 Nov 2009 14:15:36 -0500 Subject: [PATCH] errors should be QMessageBoxes, not printfs --- src/CpintPlot.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index 1ec45c999..9280526db 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -220,8 +220,13 @@ read_one(const char *inname, QVector &bests, QVector &bestDates, double mins; int watts; if (sscanf(line, "%lf %d\n", &mins, &watts) != 2) { - fprintf(stderr, "Bad match on line %d: %s", lineno, line); - exit(1); + QMessageBox::warning( + NULL, "Warning", + QString("Error reading %1, line %2").arg(inname).arg(line), + QMessageBox::Ok, + QMessageBox::NoButton); + fclose(in); + return -1; } int secs = (int) round(mins * 60.0); if (secs >= bests.size()) { @@ -318,7 +323,12 @@ CpintPlot::deriveCPParameters() int iteration = 0; do { if (iteration ++ > max_loops) { - fprintf(stderr, "maximum number of loops %d exceeded in cp model extraction\n", max_loops); + QMessageBox::warning( + NULL, "Warning", + QString("Maximum number of loops %d exceeded in cp model" + "extraction").arg(max_loops), + QMessageBox::Ok, + QMessageBox::NoButton); break; } @@ -525,7 +535,6 @@ CpintPlot::calculate(RideItem *rideItem) delete CPCurve; CPCurve = NULL; } - fflush(stderr); bool aborted = false; QList to_update; cpi_files_to_update(dir, to_update);