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:
commit
413a9b25c4
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user