search: Remove unused MUTLIPLE_* match types
https://bugzilla.gnome.org/show_bug.cgi?id=675328
This commit is contained in:
parent
0bf6c93faa
commit
7ba8c7c2b5
@ -396,9 +396,7 @@ const PlaceSearchProvider = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_searchPlaces: function(places, terms) {
|
_searchPlaces: function(places, terms) {
|
||||||
let multiplePrefixResults = [];
|
|
||||||
let prefixResults = [];
|
let prefixResults = [];
|
||||||
let multipleSubstringResults = [];
|
|
||||||
let substringResults = [];
|
let substringResults = [];
|
||||||
|
|
||||||
terms = terms.map(String.toLowerCase);
|
terms = terms.map(String.toLowerCase);
|
||||||
@ -406,20 +404,15 @@ const PlaceSearchProvider = new Lang.Class({
|
|||||||
for (let i = 0; i < places.length; i++) {
|
for (let i = 0; i < places.length; i++) {
|
||||||
let place = places[i];
|
let place = places[i];
|
||||||
let mtype = place.matchTerms(terms);
|
let mtype = place.matchTerms(terms);
|
||||||
if (mtype == Search.MatchType.MULTIPLE_PREFIX)
|
if (mtype == Search.MatchType.PREFIX)
|
||||||
multiplePrefixResults.push(place.id);
|
|
||||||
else if (mtype == Search.MatchType.PREFIX)
|
|
||||||
prefixResults.push(place.id);
|
prefixResults.push(place.id);
|
||||||
else if (mtype == Search.MatchType.MULTIPLE_SUBSTRING)
|
|
||||||
multipleSubstringResults.push(place.id);
|
|
||||||
else if (mtype == Search.MatchType.SUBSTRING)
|
else if (mtype == Search.MatchType.SUBSTRING)
|
||||||
substringResults.push(place.id);
|
substringResults.push(place.id);
|
||||||
}
|
}
|
||||||
multiplePrefixResults.sort(this._compareResultMeta);
|
|
||||||
prefixResults.sort(this._compareResultMeta);
|
prefixResults.sort(this._compareResultMeta);
|
||||||
multipleSubstringResults.sort(this._compareResultMeta);
|
|
||||||
substringResults.sort(this._compareResultMeta);
|
substringResults.sort(this._compareResultMeta);
|
||||||
return multiplePrefixResults.concat(prefixResults.concat(multipleSubstringResults.concat(substringResults)));
|
|
||||||
|
return prefixResults.concat(substringResults);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
|
@ -18,9 +18,7 @@ const DISABLED_OPEN_SEARCH_PROVIDERS_KEY = 'disabled-open-search-providers';
|
|||||||
const MatchType = {
|
const MatchType = {
|
||||||
NONE: 0,
|
NONE: 0,
|
||||||
SUBSTRING: 1,
|
SUBSTRING: 1,
|
||||||
MULTIPLE_SUBSTRING: 2,
|
PREFIX: 2
|
||||||
PREFIX: 3,
|
|
||||||
MULTIPLE_PREFIX: 4
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const SearchResultDisplay = new Lang.Class({
|
const SearchResultDisplay = new Lang.Class({
|
||||||
|
Loading…
Reference in New Issue
Block a user