Changeset 2226 in josm
- Timestamp:
- 2009-10-03T11:28:33+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r2212 r2226 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 { … … 158 159 public static void searchWithHistory(SearchSetting s) { 159 160 if(searchHistory.isEmpty() || !s.equals(searchHistory.getFirst())) { 160 searchHistory.addFirst( s);161 } 162 while (searchHistory.size() > SEARCH_HISTORY_SIZE) {161 searchHistory.addFirst(new SearchSetting(s)); 162 } 163 while (searchHistory.size() > Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE)) { 163 164 searchHistory.removeLast(); 164 165 } … … 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() {
Note:
See TracChangeset
for help on using the changeset viewer.