Ignore:
Timestamp:
2014-03-10T02:33:20+01:00 (10 years ago)
Author:
Don-vip
Message:

refactor duplicated code - impacts some plugins (reverter, roadsigns, cmdline)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r6733 r6906  
    7171            availablePlugins.addAll(available);
    7272        }
     73        availablePluginsModified();
     74    }
     75
     76    protected final void availablePluginsModified() {
    7377        sort();
    7478        filterDisplayedPlugins(filterExpression);
     
    8690    }
    8791
    88     protected  void updateAvailablePlugin(PluginInformation other) {
     92    protected void updateAvailablePlugin(PluginInformation other) {
    8993        if (other == null) return;
    9094        PluginInformation pi = getPluginInformation(other.name);
     
    106110            updateAvailablePlugin(other);
    107111        }
    108         sort();
    109         filterDisplayedPlugins(filterExpression);
    110         Set<String> activePlugins = new HashSet<String>();
    111         activePlugins.addAll(Main.pref.getCollection("plugins", activePlugins));
    112         for (PluginInformation pi: availablePlugins) {
    113             if (selectedPluginsMap.get(pi) == null) {
    114                 if (activePlugins.contains(pi.name)) {
    115                     selectedPluginsMap.put(pi, true);
    116                 }
    117             }
    118         }
    119         clearChanged();
    120         notifyObservers();
     112        availablePluginsModified();
    121113    }
    122114
Note: See TracChangeset for help on using the changeset viewer.