Ticket #19053: 19053.5.patch
File 19053.5.patch, 3.0 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/OsmValidator.java
234 234 } catch (SecurityException e) { 235 235 Logging.log(Logging.LEVEL_ERROR, "Unable to load ignored errors", e); 236 236 } 237 // see #19053: remove invalid entry 238 ignoredErrors.remove("3000"); 237 // see #19053: 238 String legacyEntry = ignoredErrors.remove("3000"); 239 if (legacyEntry != null) { 240 if (!legacyEntry.isEmpty()) { 241 addIgnoredError("3000_" + legacyEntry, legacyEntry); 242 } 243 saveIgnoredErrors(); 244 } 245 239 246 } 240 247 } 241 248 -
src/org/openstreetmap/josm/data/validation/TestError.java
338 338 * @return The ignore sub group 339 339 */ 340 340 public String getIgnoreSubGroup() { 341 if (code == 3000) { 342 // see #19053 343 return "3000_" + (description == null ? descriptionEn : description); 344 } 341 345 String ignorestring = getIgnoreGroup(); 342 346 if (descriptionEn != null) { 343 347 ignorestring += '_' + descriptionEn; … … 351 355 * @see TestError#getIgnoreSubGroup() 352 356 */ 353 357 public String getIgnoreGroup() { 358 if (code == 3000) { 359 // see #19053 360 return "3000_" + getMessage(); 361 } 354 362 return Integer.toString(code); 355 363 } 356 364 … … 524 532 public String toString() { 525 533 return "TestError [tester=" + tester + ", code=" + code + ", message=" + message + ']'; 526 534 } 535 527 536 } -
src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
410 410 411 411 lastSelectedNode = node; 412 412 if (node != null) { 413 final Set<String> codes = new HashSet<>();414 413 ValidatorTreePanel.visitTestErrors(node, error -> { 415 codes.add(error.getIgnoreSubGroup()); // see #19053416 414 error.setSelected(true); 417 415 418 416 hasFixes.set(hasFixes.get() || error.isFixable()); … … 424 422 }); 425 423 selectAction.setEnabled(true); 426 424 if (ignoreAction != null) { 427 ignoreAction.setEnabled(!(node.getUserObject() instanceof Severity) && codes.size() <= 1);425 ignoreAction.setEnabled(!(node.getUserObject() instanceof Severity)); 428 426 } 429 427 } 430 428