Changeset 5856 in josm for trunk


Ignore:
Timestamp:
2013-04-14T13:07:11+02:00 (7 years ago)
Author:
akks
Message:

fix #8601: Cancel-button doesn't cancel while downloading history

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java

    r5476 r5856  
    5151    private HashSet<PrimitiveId> toLoad;
    5252    private HistoryDataSet loadedData;
     53    private OsmServerHistoryReader reader = null;
    5354
    5455    public HistoryLoadTask() {
     
    159160    @Override
    160161    protected void cancel() {
    161         OsmApi.getOsmApi().cancel();
     162        System.out.println("Cancel!");
     163        //OsmApi.getOsmApi().cancel();
     164        // fix #8601 : could not cancel when server is extremely slow
     165        if (reader!=null) reader.cancel();
    162166        canceled = true;
    163167    }
     
    191195                progressMonitor.indeterminateSubTask(tr(msg,
    192196                        Long.toString(pid.getUniqueId())));
    193                 OsmServerHistoryReader reader = null;
     197                reader = null;
    194198                HistoryDataSet ds = null;
    195199                try {
Note: See TracChangeset for help on using the changeset viewer.