This commit is contained in:
Kovid Goyal 2011-04-22 07:56:45 -06:00
parent 24ea3c4327
commit ec8b8bbe69

View File

@ -221,7 +221,12 @@ class Matches(QAbstractItemModel):
self.reset() self.reset()
def reorder_matches(self): def reorder_matches(self):
self.matches = sorted(self.matches, key=lambda x: self.all_matches.index(x)) def keygen(x):
try:
return self.all_matches.index(x)
except:
return 100000
self.matches = sorted(self.matches, key=keygen)
class SearchFilter(SearchQueryParser): class SearchFilter(SearchQueryParser):
@ -327,5 +332,6 @@ class SearchFilter(SearchQueryParser):
matches.add(sr) matches.add(sr)
break break
except ValueError: # Unicode errors except ValueError: # Unicode errors
import traceback
traceback.print_exc() traceback.print_exc()
return matches return matches