Changeset 18546 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-11-10T23:43:25+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r18544 r18546 174 174 175 175 public static void refreshConfiguration() { 176 source = Main.pref.get("cadastrewms.source", 177 "cadastre-dgi-fr source : Direction G\u00e9n\u00e9rale des Imp\u00f4ts - Cadastre ; mise \u00e0 jour : AAAA"); 176 source = checkSourceMillesime(); 178 177 autoSourcing = Main.pref.getBoolean("cadastrewms.autosourcing", true); 179 178 alterColors = Main.pref.getBoolean("cadastrewms.alterColors"); … … 280 279 dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 281 280 } 281 282 private static String checkSourceMillesime() { 283 java.util.Calendar calendar = java.util.Calendar.getInstance(); 284 int currentYear = calendar.get(java.util.Calendar.YEAR); 285 String src = Main.pref.get("cadastrewms.source", 286 "cadastre-dgi-fr source : Direction G\u00e9n\u00e9rale des Imp\u00f4ts - Cadastre ; mise \u00e0 jour : AAAA"); 287 String srcYear = src.substring(src.lastIndexOf(" ")+1); 288 Integer year = null; 289 try { 290 year = Integer.decode(srcYear); 291 } catch (NumberFormatException e) {} 292 if (srcYear.equals("AAAA") || (year != null && year < currentYear)) { 293 System.out.println("Replace source year "+srcYear+" by current year "+currentYear); 294 src = src.substring(0, src.lastIndexOf(" ")+1)+currentYear; 295 Main.pref.put("cadastrewms.source", src); 296 } 297 return src; 298 } 282 299 }
Note:
See TracChangeset
for help on using the changeset viewer.