1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-20 12:19:11 +02:00

Compare commits

..

No commits in common. "d7d193871a9a5231ea46378bfe96ba29f651b037" and "53685253d7696bee1ad273f4bb4541c21c508e75" have entirely different histories.

2 changed files with 38 additions and 22 deletions

View File

@ -587,7 +587,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="487"/> <location filename="../src/GUI/gui.cpp" line="487"/>
<source>Show local DEM tiles</source> <source>Show local DEM tiles</source>
<translation>Näytä paikalliset DEM-laatat</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="490"/> <location filename="../src/GUI/gui.cpp" line="490"/>
@ -699,7 +699,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="695"/> <location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source> <source>Layers</source>
<translation>Kerrokset</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="721"/> <location filename="../src/GUI/gui.cpp" line="721"/>
@ -850,12 +850,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="1998"/> <location filename="../src/GUI/gui.cpp" line="1998"/>
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source> <source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
<translation>DEM-laattojen latausraja ylitetty. Jos todella tarvitset tietoja niin suurelta alueelta, lataa tiedostot manuaalisesti.</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="2014"/> <location filename="../src/GUI/gui.cpp" line="2014"/>
<source>Could not download all required DEM files.</source> <source>Could not download all required DEM files.</source>
<translation>Kaikkia vaadittuja DEM-tiedostoja ei voitu ladata.</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="2048"/> <location filename="../src/GUI/gui.cpp" line="2048"/>
@ -898,12 +898,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="476"/> <location filename="../src/GUI/gui.cpp" line="476"/>
<source>Download data DEM</source> <source>Download data DEM</source>
<translation>Lataa data-DEM</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="482"/> <location filename="../src/GUI/gui.cpp" line="482"/>
<source>Download map DEM</source> <source>Download map DEM</source>
<translation>Lataa kartta-DEM</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="762"/> <location filename="../src/GUI/gui.cpp" line="762"/>
@ -961,7 +961,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="1978"/> <location filename="../src/GUI/gui.cpp" line="1978"/>
<source>Clear &quot;%1&quot; tile cache?</source> <source>Clear &quot;%1&quot; tile cache?</source>
<translation>Tyhjennetäänkö &quot;%1&quot; ruutuvälimuisti?</translation> <translation type="unfinished"></translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="2001"/> <location filename="../src/GUI/gui.cpp" line="2001"/>

View File

@ -6,23 +6,31 @@ bool AtlasData::pointCb(MapEntry *map, void *context)
{ {
PointCTX *ctx = (PointCTX*)context; PointCTX *ctx = (PointCTX*)context;
map->lock.lock(); start:
ctx->cacheLock.lock(); ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path); MapData *cached = ctx->cache.object(map->path);
if (!cached) { if (!cached) {
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
if (map->lock.tryLock()) {
MapData *data = new MapData(map->path); MapData *data = new MapData(map->path);
data->points(ctx->rect, ctx->points); data->points(ctx->rect, ctx->points);
ctx->cacheLock.lock(); ctx->cacheLock.lock();
ctx->cache.insert(map->path, data); ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
} else } else
cached->points(ctx->rect, ctx->points); cached->points(ctx->rect, ctx->points);
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
map->lock.unlock();
return true; return true;
} }
@ -31,26 +39,34 @@ bool AtlasData::polyCb(MapEntry *map, void *context)
{ {
PolyCTX *ctx = (PolyCTX*)context; PolyCTX *ctx = (PolyCTX*)context;
map->lock.lock(); start:
ctx->cacheLock.lock(); ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path); MapData *cached = ctx->cache.object(map->path);
if (!cached) { if (!cached) {
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
if (map->lock.tryLock()) {
MapData *data = new MapData(map->path); MapData *data = new MapData(map->path);
data->polygons(ctx->rect, ctx->polygons); data->polygons(ctx->rect, ctx->polygons);
data->lines(ctx->rect, ctx->lines); data->lines(ctx->rect, ctx->lines);
ctx->cacheLock.lock(); ctx->cacheLock.lock();
ctx->cache.insert(map->path, data); ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
} else { } else {
cached->polygons(ctx->rect, ctx->polygons); cached->polygons(ctx->rect, ctx->polygons);
cached->lines(ctx->rect, ctx->lines); cached->lines(ctx->rect, ctx->lines);
} }
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
map->lock.unlock();
return true; return true;
} }