Changeset 1451 in josm


Ignore:
Timestamp:
2009-02-28T20:27:54+01:00 (13 years ago)
Author:
stoecker
Message:

fix #2247. patch by xeen - cleanup search history

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r1397 r1451  
    124124     */
    125125    public static void searchWithHistory(SearchSetting s) {
    126         searchHistory.addFirst(s);
     126        if(searchHistory.isEmpty() || !s.equals(searchHistory.getFirst()))
     127            searchHistory.addFirst(s);
    127128        while (searchHistory.size() > SEARCH_HISTORY_SIZE)
    128129            searchHistory.removeLast();
     
    203204        }
    204205
     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        }
    205215    }
    206216}
Note: See TracChangeset for help on using the changeset viewer.