Ticket #6565: patch.txt

File patch.txt, 2.1 KB (added by Don-vip, 13 years ago)
Line 
1Index: src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
2===================================================================
3--- src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java (revision 4216)
4+++ src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java (working copy)
5@@ -299,7 +299,7 @@
6 if (in == null) return;
7 progressMonitor.subTask(tr("Downloading OSM data..."));
8 try {
9- DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
10+ DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(pkg.size(), false));
11 rememberNodesOfIncompleteWaysToLoad(loaded);
12 merge(loaded);
13 } catch(Exception e) {
14@@ -323,7 +323,7 @@
15 return;
16 progressMonitor.subTask(tr("Downloading OSM data..."));
17 try {
18- DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
19+ DataSet loaded = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(1, false));
20 rememberNodesOfIncompleteWaysToLoad(loaded);
21 merge(loaded);
22 } catch(Exception e) {
23@@ -403,11 +403,12 @@
24 case WAY: msg = tr("Fetching a package of ways from ''{0}''", OsmApi.getOsmApi().getBaseUrl()); break;
25 case RELATION: msg = tr("Fetching a package of relations from ''{0}''", OsmApi.getOsmApi().getBaseUrl()); break;
26 }
27- progressMonitor.indeterminateSubTask(msg);
28+ progressMonitor.setTicksCount(ids.size());
29+ progressMonitor.setTicks(0);
30 Set<Long> toFetch = new HashSet<Long>(ids);
31- toFetch.addAll(ids);
32 while(! toFetch.isEmpty() && !isCanceled()) {
33 Set<Long> pkg = extractIdPackage(toFetch);
34+ progressMonitor.subTask(msg + "... " + progressMonitor.getTicks() + "/" + progressMonitor.getTicksCount());
35 try {
36 multiGetIdPackage(type, pkg, progressMonitor);
37 } catch(OsmApiException e) {