kopia lustrzana https://github.com/JOSM/MapWithAI
Fix #23390: Progress Monitor needs to send child monitors to avoid being in the finished state
Signed-off-by: Taylor Smock <smocktaylor@gmail.com>pull/45/head v823
rodzic
eff911c300
commit
d56513358d
|
@ -330,19 +330,22 @@ public class BoundingBoxMapWithAIDownloader extends BoundingBoxDownloader {
|
||||||
}
|
}
|
||||||
ds = new DataSet();
|
ds = new DataSet();
|
||||||
final var currentBounds = new Bounds(this.downloadArea);
|
final var currentBounds = new Bounds(this.downloadArea);
|
||||||
|
progressMonitor.beginTask(tr("Downloading data"), 2 * tiles.size());
|
||||||
for (TileXYZ tileXYZ : tiles) {
|
for (TileXYZ tileXYZ : tiles) {
|
||||||
try {
|
try {
|
||||||
final var hilbert = PMTiles.convertToHilbert(tileXYZ.z(), tileXYZ.x(), tileXYZ.y());
|
final var hilbert = PMTiles.convertToHilbert(tileXYZ.z(), tileXYZ.x(), tileXYZ.y());
|
||||||
final var data = this.info.getSourceType() == MapWithAIType.PMTILES
|
final var data = this.info.getSourceType() == MapWithAIType.PMTILES
|
||||||
? new ByteArrayInputStream(PMTiles.readData(header, hilbert, cachedDirectories))
|
? new ByteArrayInputStream(PMTiles.readData(header, hilbert, cachedDirectories))
|
||||||
: getInputStream(getRequestForTile(tileXYZ), progressMonitor);
|
: getInputStream(getRequestForTile(tileXYZ), progressMonitor.createSubTaskMonitor(1, true));
|
||||||
final var dataSet = loadTile(tileSource, tileXYZ, data);
|
final var dataSet = loadTile(tileSource, tileXYZ, data);
|
||||||
ds.mergeFrom(dataSet, progressMonitor);
|
ds.mergeFrom(dataSet, progressMonitor.createSubTaskMonitor(1, true));
|
||||||
tileXYZ.expandBounds(currentBounds);
|
tileXYZ.expandBounds(currentBounds);
|
||||||
} catch (OsmTransferException | IOException e) {
|
} catch (OsmTransferException | IOException e) {
|
||||||
|
progressMonitor.finishTask();
|
||||||
throw new IllegalDataException(e);
|
throw new IllegalDataException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
progressMonitor.finishTask();
|
||||||
ds.addDataSource(new DataSource(currentBounds, this.url));
|
ds.addDataSource(new DataSource(currentBounds, this.url));
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue