Changeset 17202 in josm


Ignore:
Timestamp:
2020-10-15T08:27:39+02:00 (6 days ago)
Author:
GerdP
Message:

see #19920: Cancel doesn't work with "Download All Children"

  • let Cancel call MultiFetchServerObjectReader.cancel() instead of OsmApi.getOsmApi().cancel();
  • only download child relations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r16913 r17202  
    4747import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    4848import org.openstreetmap.josm.io.MultiFetchServerObjectReader;
    49 import org.openstreetmap.josm.io.OsmApi;
    5049import org.openstreetmap.josm.io.OsmTransferException;
    5150import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    324323        protected int conflictsCount;
    325324        protected Exception lastException;
     325        protected MultiFetchServerObjectReader reader;
    326326
    327327        DownloadTask(String title, Dialog parent) {
     
    332332        protected void cancel() {
    333333            canceled = true;
    334             OsmApi.getOsmApi().cancel();
     334            synchronized (this) {
     335                if (reader != null) {
     336                    reader.cancel();
     337                }
     338            }
    335339        }
    336340
     
    423427        protected void realRun() throws SAXException, IOException, OsmTransferException {
    424428            try {
    425                 MultiFetchServerObjectReader reader = createReader();
    426                 reader.append(relation.getMemberPrimitives());
     429                reader = createReader();
     430                reader.append(relation.getMemberPrimitives(Relation.class));
    427431                DataSet dataSet = reader.parseOsm(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
    428432                mergeDataSet(dataSet);
     
    456460        protected void realRun() throws SAXException, IOException, OsmTransferException {
    457461            try {
    458                 MultiFetchServerObjectReader reader = createReader();
     462                reader = createReader();
    459463                reader.append(relations);
    460464                DataSet dataSet = reader.parseOsm(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
Note: See TracChangeset for help on using the changeset viewer.