Ticket #3544: shfix.patch
File shfix.patch, 1.5 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/actions/search/SearchAction.java
28 28 29 29 public class SearchAction extends JosmAction{ 30 30 31 public static final int SEARCH_HISTORY_SIZE = 10;31 public static final int DEFAULT_SEARCH_HISTORY_SIZE = 10; 32 32 33 33 34 public static enum SearchMode { 34 35 replace, add, remove, in_selection 35 36 } … … 157 158 */ 158 159 public static void searchWithHistory(SearchSetting s) { 159 160 if(searchHistory.isEmpty() || !s.equals(searchHistory.getFirst())) { 160 searchHistory.addFirst( s);161 searchHistory.addFirst(new SearchSetting(s)); 161 162 } 162 while (searchHistory.size() > SEARCH_HISTORY_SIZE) {163 while (searchHistory.size() > Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE)) { 163 164 searchHistory.removeLast(); 164 165 } 165 166 lastSearch = s; … … 279 280 this.text = text; 280 281 } 281 282 283 public SearchSetting(SearchSetting original) { 284 super(); 285 this.caseSensitive = original.caseSensitive; 286 this.regexSearch = original.regexSearch; 287 this.mode = original.mode; 288 this.text = original.text; 289 } 290 282 291 @Override 283 292 public String toString() { 284 293 String cs = caseSensitive ? tr("CS") : tr("CI");