Ignore:
Timestamp:
2009-08-02T18:02:44+02:00 (16 years ago)
Author:
Gubaer
Message:

fixed two issues in #3141: conflict resolution flags false conflicts on nodes

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r1811 r1881  
    6363    private DataSet outputDataSet;
    6464
     65    private boolean cancelled = false;
     66
    6567    /**
    6668     * constructor
     
    230232     *
    231233     */
    232     public MultiFetchServerObjectReader append(Collection<OsmPrimitive> primitives) {
     234    public MultiFetchServerObjectReader append(Collection<? extends OsmPrimitive> primitives) {
    233235        if (primitives == null) return this;
    234236        for (OsmPrimitive primitive : primitives) {
     
    363365        for (long id : pkg) {
    364366            try {
     367                progressMonitor.setCustomText(tr("Fetching {0} with id {1} from ''{2}''", type.getLocalizedDisplayNameSingular(), id, OsmApi.getOsmApi().getBaseUrl()));
    365368                singleGetId(type, id, progressMonitor);
    366369            } catch(OsmApiException e) {
     
    394397     */
    395398    protected void fetchPrimitives(Set<Long> ids, OsmPrimitiveType type, ProgressMonitor progressMonitor) throws OsmTransferException{
     399        progressMonitor.setCustomText(tr("Fetching a package of {0} from ''{1}''", type.getLocalizedDisplayNameSingular(), OsmApi.getOsmApi().getBaseUrl()));
    396400        Set<Long> toFetch = new HashSet<Long>(ids);
    397401        toFetch.addAll(ids);
    398         while(! toFetch.isEmpty()) {
     402        while(! toFetch.isEmpty() && !isCanceled()) {
    399403            Set<Long> pkg = extractIdPackage(toFetch);
    400404            try {
     
    435439        try {
    436440            missingPrimitives = new HashSet<Long>();
    437 
     441            if (isCanceled())return null;
    438442            fetchPrimitives(nodes,OsmPrimitiveType.NODE, progressMonitor);
     443            if (isCanceled())return null;
    439444            fetchPrimitives(ways,OsmPrimitiveType.WAY, progressMonitor);
     445            if (isCanceled())return null;
    440446            fetchPrimitives(relations,OsmPrimitiveType.RELATION, progressMonitor);
    441447            return outputDataSet;
  • trunk/src/org/openstreetmap/josm/io/OsmConnection.java

    r1811 r1881  
    145145        con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes));
    146146    }
     147
     148    /**
     149     * Replies true if this connection is canceled
     150     *
     151     * @return true if this connection is canceled
     152     * @return
     153     */
     154    public boolean isCanceled() {
     155        return cancel;
     156    }
    147157}
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r1814 r1881  
    329329        for (Entry<OsmPrimitiveData, Collection<Long>> e : ways.entrySet()) {
    330330            Way w = new Way(e.getKey().id);
    331             boolean failed = false;
     331            boolean incomplete = false;
    332332            for (long id : e.getValue()) {
    333333                Node n = findNode(id);
    334334                if (n == null) {
    335                     failed = true;
    336                     break;
     335                    n = new Node(id);
     336                    n.incomplete = true;
     337                    incomplete = true;
    337338                }
    338339                w.nodes.add(n);
    339340            }
    340             if (failed) {
    341                 logger.warning(tr("marked way {0} incomplete because referred nodes are missing in the loaded data", e.getKey().id));
     341            if (incomplete) {
     342                logger.warning(tr("marked way {0} with {1} nodes incomplete because at least one node was missing in the loaded data and is therefore incomplete too", e.getKey().id, w.nodes.size()));
    342343                e.getKey().copyTo(w);
    343344                w.incomplete = true;
    344                 w.nodes.clear();
    345345                ds.addPrimitive(w);
    346346            } else {
Note: See TracChangeset for help on using the changeset viewer.