Ignore:
Timestamp:
2010-03-06T12:37:34+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #4443: Plugins with known update site: Don't download unless a new version is available
fixed #4565: local version differs from local version of updated plugin (was: local version number lost, after update plugin list.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java

    r3083 r3090  
    3838    private static final Logger logger = Logger.getLogger(PluginDownloadTask.class.getName());
    3939
    40     private final Collection<PluginInformation> toUpdate;
     40    private final Collection<PluginInformation> toUpdate = new LinkedList<PluginInformation>();
    4141    private final Collection<PluginInformation> failed = new LinkedList<PluginInformation>();
    4242    private final Collection<PluginInformation> downloaded = new LinkedList<PluginInformation>();
     
    5656        super(parent, title == null ? "" : title, false /* don't ignore exceptions */);
    5757        CheckParameterUtil.ensureParameterNotNull(toUpdate, "toUpdate");
    58         this.toUpdate = toUpdate;
     58        this.toUpdate.addAll(toUpdate);
    5959    }
    6060
     
    7070        super(title, monitor == null? NullProgressMonitor.INSTANCE: monitor, false /* don't ignore exceptions */);
    7171        CheckParameterUtil.ensureParameterNotNull(toUpdate, "toUpdate");
    72         this.toUpdate = toUpdate;
     72        this.toUpdate.addAll(toUpdate);
     73    }
     74
     75    /**
     76     * Sets the collection of plugins to update.
     77     *
     78     * @param toUpdate the collection of plugins to update. Must not be null.
     79     * @throws IllegalArgumentException thrown if toUpdate is null
     80     */
     81    public void setPluginsToDownload(Collection<PluginInformation> toUpdate) throws IllegalArgumentException{
     82        CheckParameterUtil.ensureParameterNotNull(toUpdate, "toUpdate");
     83        this.toUpdate.clear();
     84        this.toUpdate.addAll(toUpdate);
    7385    }
    7486
Note: See TracChangeset for help on using the changeset viewer.