1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Merge pull request #2 from luznicky/master

Fixed bad line count when incorrect line in mapfile is skipped.
This commit is contained in:
Martin Tůma 2015-12-01 22:59:12 +01:00
commit 413a9b25c4

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;