1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 06:43:22 +02:00

Bad line count when incorrect line in mapfile is skipped.

This commit is contained in:
Jiri Luznicky 2015-12-01 22:31:39 +01:00
parent a809c81fd6
commit 8a44b7d290

View File

@ -19,8 +19,9 @@ QList<Map*> MapList::load(const QString &fileName)
return mapList;
}
int ln = 1;
int ln = 0;
while (!file.atEnd()) {
ln++;
QByteArray line = file.readLine();
QList<QByteArray> list = line.split('\t');
if (list.size() != 2) {
@ -33,8 +34,6 @@ QList<Map*> MapList::load(const QString &fileName)
mapList.append(new Map(QString::fromUtf8(ba1.data(), ba1.size()),
QString::fromLatin1(ba2.data(), ba2.size())));
ln++;
}
return mapList;