1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01: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; return mapList;
} }
int ln = 1; int ln = 0;
while (!file.atEnd()) { while (!file.atEnd()) {
ln++;
QByteArray line = file.readLine(); QByteArray line = file.readLine();
QList<QByteArray> list = line.split('\t'); QList<QByteArray> list = line.split('\t');
if (list.size() != 2) { 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()), mapList.append(new Map(QString::fromUtf8(ba1.data(), ba1.size()),
QString::fromLatin1(ba2.data(), ba2.size()))); QString::fromLatin1(ba2.data(), ba2.size())));
ln++;
} }
return mapList; return mapList;