Ticket #3738: SearchAnonymousUser.patch
File SearchAnonymousUser.patch, 2.4 KB (added by , 15 years ago) |
---|
-
src/org/openstreetmap/josm/actions/search/SearchAction.java
123 123 + "<li>"+tr("<u>Special targets:</u>")+"</li>" 124 124 + "<li>"+tr("<b>type:</b> - type of the object (<b>node</b>, <b>way</b>, <b>relation</b>)")+"</li>" 125 125 + "<li>"+tr("<b>user:</b>... - all objects changed by user")+"</li>" 126 + "<li>"+tr("<b>user:anonymous</b> - all objects changed by anonymous users")+"</li>" 126 127 + "<li>"+tr("<b>id:</b>... - object with given ID (0 for new objects)")+"</li>" 127 128 + "<li>"+tr("<b>nodes:</b>... - object with given number of nodes")+"</li>" 128 129 + "<li>"+tr("<b>tags:</b>... - object with given number of tags (tags:count or tags:min-max)")+"</li>" -
src/org/openstreetmap/josm/actions/search/SearchCompiler.java
391 391 private static class UserMatch extends Match { 392 392 private User user; 393 393 public UserMatch(String user) { 394 List<User> users = User.getByName(user); 395 if (!users.isEmpty()) { 396 // selecting an arbitrary user 397 this.user = users.get(0); 394 if (user.equals("anonymous")) { 395 this.user = null; 398 396 } else { 399 user = null; 397 List<User> users = User.getByName(user); 398 if (!users.isEmpty()) { 399 // selecting an arbitrary user 400 this.user = users.get(0); 401 } else { 402 this.user = User.createLocalUser(user); 403 } 400 404 } 401 405 } 406 402 407 @Override public boolean match(OsmPrimitive osm) { 403 408 if (osm.getUser() == null && user == null) return true; 404 409 if (osm.getUser() == null) return false; 405 410 return osm.getUser().equals(user); 406 411 } 412 407 413 @Override public String toString() { 408 414 return "user=" + user == null ? "" : user.getName(); 409 415 }