Changeset 1649 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-06-07T11:22:20+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r1647 r1649 47 47 private Map<String, Boolean> pluginMap; 48 48 private Map<String, PluginInformation> availablePlugins; 49 private Map<String, PluginInformation> localPlugins; 49 50 50 51 public void updateDescription(JPanel pluginPanel) { … … 68 69 StringBuilder toUpdateStr = new StringBuilder(); 69 70 for (PluginProxy proxy : PluginHandler.pluginList) { 70 PluginInformation description = availablePlugins.get(proxy.info.name); 71 PluginInformation local = localPlugins.get(proxy.info.name); 72 PluginInformation description = availablePlugins.get(local.name); 73 71 74 if (description != null && (description.version == null || description.version.equals("")) ? 72 ( proxy.info.version != null &&proxy.info.version.equals("")) : !description.version.equals(proxy.info.version)) {75 (local.version != null && local.version.equals("")) : !description.version.equals(local.version)) { 73 76 toUpdate.add(description); 74 77 toUpdateStr.append(description.name+"\n"); … … 102 105 String name = entry.getKey(); 103 106 PluginInformation ap = availablePlugins.get(name); 104 PluginInformation pi = PluginInformation.findPlugin(name);107 PluginInformation pi = localPlugins.get(name); 105 108 boolean add = false; 106 109 if(pi == null) … … 177 180 remoteversion = tr("unknown"); 178 181 179 String localversion; 180 PluginInformation p = PluginInformation.findPlugin(plugin.name); 181 if (p != null) { 182 String localversion = ""; 183 PluginInformation p = localPlugins.get(plugin.name); 184 if(p != null) 185 { 182 186 if (p.version != null && !p.version.equals("")) 183 187 localversion = p.version; … … 185 189 localversion = tr("unknown"); 186 190 localversion = " (" + localversion + ")"; 187 } else 188 localversion = ""; 191 } 189 192 190 193 final JCheckBox pluginCheck = new JCheckBox( … … 252 255 } 253 256 }); 257 localPlugins = new TreeMap<String, PluginInformation>(new Comparator<String>(){ 258 public int compare(String o1, String o2) { 259 return o1.compareToIgnoreCase(o2); 260 } 261 }); 254 262 for (String location : PluginInformation.getPluginLocations()) { 255 263 File[] pluginFiles = new File(location).listFiles(); … … 265 273 if (!availablePlugins.containsKey(info.name)) 266 274 availablePlugins.put(info.name, info); 275 if (!localPlugins.containsKey(info.name)) 276 localPlugins.put(info.name, info); 277 } catch (PluginException x) { 278 } 279 } else if (fname.endsWith(".jar.new")) { 280 try { 281 PluginInformation info = new PluginInformation(f,fname.substring(0,fname.length()-8)); 282 availablePlugins.put(info.name, info); 283 localPlugins.put(info.name, info); 267 284 } catch (PluginException x) { 268 285 } … … 334 351 } 335 352 for (PluginProxy proxy : PluginHandler.pluginList) 353 { 336 354 if (!availablePlugins.containsKey(proxy.info.name)) 337 355 availablePlugins.put(proxy.info.name, proxy.info); 356 if (!localPlugins.containsKey(proxy.info.name)) 357 localPlugins.put(proxy.info.name, proxy.info); 358 } 338 359 return availablePlugins; 339 360 }
Note:
See TracChangeset
for help on using the changeset viewer.