Changeset 10781 in josm for trunk/src


Ignore:
Timestamp:
2016-08-11T15:26:20+02:00 (8 years ago)
Author:
simon04
Message:

fix #11874 - No progress bar while downloading plugins

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r10715 r10781  
    216216        @Override
    217217        public void beginTask(String title) {
    218             if (title != null) {
     218            if (title != null && !title.isEmpty()) {
    219219                if (Main.isDebugEnabled()) {
    220220                    Main.debug(title);
     
    258258        @Override
    259259        public ProgressMonitor createSubTaskMonitor(int ticks, boolean internal) {
    260             return latestSubtask;
     260            if (latestSubtask != null) {
     261                return latestSubtask;
     262            } else {
     263                // subTask has not been called before, such as for plugin update, #11874
     264                return this;
     265            }
    261266        }
    262267
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r10768 r10781  
    6767import org.openstreetmap.josm.tools.I18n;
    6868import org.openstreetmap.josm.tools.ImageProvider;
     69import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    6970import org.openstreetmap.josm.tools.Utils;
    7071
     
    986987                // If only some plugins have to be updated, filter the list
    987988                if (pluginsWanted != null && !pluginsWanted.isEmpty()) {
    988                     for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {
    989                         PluginInformation pi = it.next();
    990                         boolean found = false;
    991                         for (PluginInformation piw : pluginsWanted) {
    992                             if (pi.name.equals(piw.name)) {
    993                                 found = true;
    994                                 break;
    995                             }
    996                         }
    997                         if (!found) {
    998                             it.remove();
    999                         }
    1000                     }
     989                    final Collection<String> pluginsWantedName = Utils.transform(pluginsWanted, piw -> piw.name);
     990                    plugins = SubclassFilteredCollection.filter(plugins, pi -> pluginsWantedName.contains(pi.name));
    1001991                }
    1002992            } catch (RuntimeException e) {
Note: See TracChangeset for help on using the changeset viewer.