Ticket #2247: NoRepeats!.patch
| File NoRepeats!.patch, 1.2 KB (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/search/SearchAction.java
123 123 * @param s 124 124 */ 125 125 public static void searchWithHistory(SearchSetting s) { 126 searchHistory.addFirst(s); 126 if(searchHistory.isEmpty() || !s.equals(searchHistory.getFirst())) 127 searchHistory.addFirst(s); 127 128 while (searchHistory.size() > SEARCH_HISTORY_SIZE) 128 129 searchHistory.removeLast(); 129 130 lastSearch = s; … … 202 203 return "\"" + text + "\" (" + cs + rx + ", " + mode + ")"; 203 204 } 204 205 206 public boolean equals(Object other) { 207 if(!(other instanceof SearchSetting)) 208 return false; 209 SearchSetting o = (SearchSetting) other; 210 return (o.caseSensitive == this.caseSensitive 211 && o.regexSearch == this.regexSearch 212 && o.mode.equals(this.mode) 213 && o.text.equals(this.text)); 214 } 205 215 } 206 216 }
