Ticket #1287: 5-musiccompare.patch

File 5-musiccompare.patch, 1.2 KB (added by eskil <myth@…>, 18 years ago)

Metadata and MusicNode? uses locale aware comparisons

  • mythmusic/mythmusic/metadata.cpp

     
    123129{
    124130    if (format == "cast")
    125131    {
    126         int artist_cmp = qstrcmp (Artist(), other->Artist());
    127         int title_cmp = qstrcmp (Title(), other->Title());
     132        int artist_cmp = Artist().lower().localeAwareCompare(other->Artist().lower());
    128133       
    129134        if (artist_cmp == 0)
    130             return title_cmp;
     135            return Title().lower().localeAwareCompare(other->Title().lower());
    131136       
    132137        return artist_cmp;
    133138    }
     
    15461585    QString title2 = itemB->getTitle().lower();
    15471586   
    15481587    // Cut "the " off the front of titles
    1549     title1 = (title1.lower().left(4) == thePrefix) ? title1.mid(4) : title1;
    1550     title2 = (title2.lower().left(4) == thePrefix) ? title2.mid(4) : title2;
     1588    if (title1.left(4) == thePrefix)
     1589        title1 = title1.mid(4);
     1590    if (title2.left(4) == thePrefix)
     1591        title2 = title2.mid(4);
    15511592
    1552     return qstrcmp(title1, title2);
     1593    return title1.localeAwareCompare(title2);
    15531594}