mirror of
https://github.com/transmission/transmission
synced 2025-03-19 10:15:36 +00:00
(trunk web) use String.localeCompare() instead of rolling our own compareTo() function.
This commit is contained in:
parent
af1d2b76c0
commit
c44ce249d2
2 changed files with 1 additions and 12 deletions
|
@ -128,16 +128,6 @@ String.prototype.trim = function () {
|
|||
return this.replace(/^\s*/, "").replace(/\s*$/, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief strcmp()-style compare useful for sorting
|
||||
*/
|
||||
String.prototype.compareTo = function(that) {
|
||||
// FIXME: how to fold these two comparisons together?
|
||||
if (this < that) return -1;
|
||||
if (this > that) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***
|
||||
**** Preferences
|
||||
***/
|
||||
|
@ -176,7 +166,6 @@ Prefs._Defaults =
|
|||
{
|
||||
'filter': 'all',
|
||||
'refresh_rate' : 5,
|
||||
'show_filter': true,
|
||||
'sort_direction': 'ascending',
|
||||
'sort_method': 'name',
|
||||
'turtle-state' : false,
|
||||
|
|
|
@ -358,7 +358,7 @@ Torrent.compareById = function(ta, tb)
|
|||
};
|
||||
Torrent.compareByName = function(ta, tb)
|
||||
{
|
||||
return ta.getCollatedName().compareTo(tb.getCollatedName())
|
||||
return ta.getCollatedName().localeCompare(tb.getCollatedName())
|
||||
|| Torrent.compareById(ta, tb);
|
||||
};
|
||||
Torrent.compareByQueue = function(ta, tb)
|
||||
|
|
Loading…
Add table
Reference in a new issue