projects
/
weightgraph
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
331de05
)
Improve data file error handling.
author
Visa Putkinen
<visa.putkinen@iki.fi>
Sat, 19 Mar 2011 23:27:05 +0000
(
01:27
+0200)
committer
Visa Putkinen
<visa.putkinen@iki.fi>
Sat, 19 Mar 2011 23:27:05 +0000
(
01:27
+0200)
weightgraph/weightdata.cpp
patch
|
blob
|
history
diff --git
a/weightgraph/weightdata.cpp
b/weightgraph/weightdata.cpp
index
fd958f4
..
d91fe54
100644
(file)
--- a/
weightgraph/weightdata.cpp
+++ b/
weightgraph/weightdata.cpp
@@
-213,6
+213,9
@@
void WeightDataModel::readFromDisk()
QString line = stream.readLine();
while (!line.isNull()) {
QStringList parts = line.split(';');
QString line = stream.readLine();
while (!line.isNull()) {
QStringList parts = line.split(';');
+ if (parts.size() != 2) {
+ throw(QString("Invalid line in file: '%1'").arg(line));
+ }
DateWeight w;
w.date = QDate::fromString(parts[0], Qt::ISODate);
if (!w.date.isValid()) {
DateWeight w;
w.date = QDate::fromString(parts[0], Qt::ISODate);
if (!w.date.isValid()) {