Bug 135823 - Sorting order for track items in Collection Browser doesn't respect locales
Summary: Sorting order for track items in Collection Browser doesn't respect locales
Status: RESOLVED INTENTIONAL
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: 2.0-SVN
Platform: Fedora RPMs Linux
: LO minor
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 132721 138242 142507 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-17 17:30 UTC by Patrick
Modified: 2009-12-09 11:28 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick 2006-10-17 17:30:30 UTC
Version:           1.4.3 (using KDE KDE 3.5.5)
Installed from:    Fedora RPMs
OS:                Linux

The items displayed in the collection panel are sorted without respect to locales. This not the case for the playlist.
Comment 1 Seb Ruiz 2006-10-17 23:34:21 UTC
Can you please be more specific and provide an example
Comment 2 Patrick 2006-10-18 00:06:31 UTC
In a locale where 'ö' is equivalent to 'o' (regarding collating), A song such as "Tö" will appear after "Tu" in the collection panel (assuming the artist is the same). In the playlist, the songs will appear in the correct order.
Comment 3 Alexandre Oliveira 2006-10-24 01:49:08 UTC
Are you refering to Tree, Ipod, or Flat view?
Comment 4 Patrick 2006-10-24 14:45:51 UTC
I'm referring to Tree view
Comment 5 Alexandre Oliveira 2006-10-24 18:59:11 UTC
Okay, and which enconding are you using?
What's the value of the LANG, LC_ALL, and LC_COLLATE environment variables?
Comment 6 Patrick 2006-10-24 19:13:00 UTC
LANG = fr_FR
LC_ALL and LC_COLLATE are not set.
Comment 7 Alexandre Oliveira 2006-10-25 22:00:36 UTC
Well, it works for me with every encoding I try, provided that I have the files for the specific encoding.
What's the output of the locale command?
All I can think is that your files are somehow messed up.
We use QString::localAwareCompare for sorting collection, just like we do on playlist.
Comment 8 Patrick 2006-10-25 23:35:14 UTC
I'm quite sure there is a bug in Amarok, since the song titles are sorted in the wrong order only when the collection is ordered by artist. For a given artist, the accented characters in song titles are not equivalent to the non accented ones, as they normally are.

On the contrary, Artist names with accented characters are correctly sorted when the collection is ordered by artist.

In addition, the playlist is always correctly sorted.

In conclusion, it works in some cases, and it fails other cases.

If I type the following command :
echo -e "td\nté\ntf" | sort
on the command line, I get :
td
té
tf
which is correct

The output of the locale command is :
LANG=fr_FR
LC_CTYPE="fr_FR"
LC_NUMERIC="fr_FR"
LC_TIME="fr_FR"
LC_COLLATE="fr_FR"
LC_MONETARY="fr_FR"
LC_MESSAGES="fr_FR"
LC_PAPER="fr_FR"
LC_NAME="fr_FR"
LC_ADDRESS="fr_FR"
LC_TELEPHONE="fr_FR"
LC_MEASUREMENT="fr_FR"
LC_IDENTIFICATION="fr_FR"
LC_ALL=
Comment 9 Alexandre Oliveira 2006-10-26 00:03:05 UTC
Ah, song titles! somehow I missed this before!
Well, I'll see what can be done about it, but probably only for 1.5, when we'll hopefully refactor some of collection browser code.
Anyway, for tracks, sorting comes directly from the database, and it means that it will work if you set the encoding and collate correctly in the database.
Comment 10 Patrick 2006-10-26 00:12:37 UTC
I don't use an external database, but only the built-in one.
Comment 11 Alexandre Oliveira 2006-12-02 20:06:52 UTC
*** Bug 138242 has been marked as a duplicate of this bug. ***
Comment 12 Bram Schoenmakers 2007-03-04 21:45:50 UTC
*** Bug 142507 has been marked as a duplicate of this bug. ***
Comment 13 shattered 2007-07-22 17:00:44 UTC
bug 132721 looks like a dup of this one, too
Comment 14 Harald Sitter 2007-07-22 18:20:58 UTC
*** Bug 132721 has been marked as a duplicate of this bug. ***
Comment 15 Lydia Pintscher 2008-08-06 00:07:00 UTC
Still present in current Amarok 2.
Comment 16 Dan Meltzer 2008-08-24 04:57:52 UTC
If this is still an issue, it's an issue in QSortFilterProxyModel.  The logic currently with reguards to our sorting is:

Check disc number, sort by that.
If disc number is =, sort by track number.
If track number is equal, or if there is no track number, ask QSortFilterProxyModel to handle the sorting for us.

The only resolution I can give is WONTFIX, according to bugzie.  It should really be CANTFIX though.

Sorry :(