mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +01:00
Use something more usefull than the tile path as the description
This commit is contained in:
parent
10cc36414a
commit
3c2b293deb
@ -16,6 +16,7 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QRegularExpression>
|
||||
#include <QLocale>
|
||||
#include <private/qzipreader_p.h>
|
||||
#include "common/rectc.h"
|
||||
#include "dem.h"
|
||||
@ -66,7 +67,6 @@ static qreal height(const Coordinates &c, const QByteArray *data)
|
||||
return interpolate(dx, dy, p0, p1, p2, p3);
|
||||
}
|
||||
|
||||
|
||||
QString DEM::Tile::latStr() const
|
||||
{
|
||||
const char ns = (_lat >= 0) ? 'N' : 'S';
|
||||
@ -144,6 +144,7 @@ QList<Area> DEM::tiles()
|
||||
QDir dir(_dir);
|
||||
QFileInfoList files(dir.entryInfoList(QDir::Files | QDir::Readable));
|
||||
QRegularExpression re("([NS])([0-9]{2})([EW])([0-9]{3})");
|
||||
QLocale l(QLocale::system());
|
||||
QList<Area> list;
|
||||
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
@ -161,7 +162,8 @@ QList<Area> DEM::tiles()
|
||||
|
||||
Area area(RectC(Coordinates(lon, lat + 1), Coordinates(lon + 1, lat)));
|
||||
area.setName(basename);
|
||||
area.setDescription(files.at(i).canonicalFilePath());
|
||||
area.setDescription(files.at(i).suffix().toUpper() + ", "
|
||||
+ l.formattedDataSize(files.at(i).size()));
|
||||
|
||||
list.append(area);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user