commit 4e7dfbad42852113bba925578403ca0c1b04d2ff parent 5920f22c52c6135d2d98056e8bd57238615bd885 Author: Dan Stillman <dstillman@zotero.org> Date: Sun, 15 Mar 2009 22:58:44 +0000 Proper locale-based sorting of saved searches Diffstat:
| M | chrome/content/zotero/xpcom/search.js | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js @@ -1525,7 +1525,16 @@ Zotero.Searches = new function(){ function getAll(){ var sql = "SELECT savedSearchID AS id, savedSearchName AS name " + "FROM savedSearches ORDER BY name COLLATE NOCASE"; - return Zotero.DB.query(sql); + var searches = Zotero.DB.query(sql); + if (!searches) { + return []; + } + // Do proper collation sort + var collation = Zotero.getLocaleCollation(); + searches.sort(function (a, b) { + return collation.compareString(1, a.name, b.name); + }); + return searches; }