mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-06 16:44:06 +00:00
PICARD-2386: Fix sorting of characters with diacritics
Columns in main list which were not using natural sorting had all characters with diacritics sorted after Z. Use locale.strxfrm for locale aware sorting instead.
This commit is contained in:
@@ -47,6 +47,7 @@ from heapq import (
|
||||
heappop,
|
||||
heappush,
|
||||
)
|
||||
from locale import strxfrm
|
||||
|
||||
from PyQt5 import (
|
||||
QtCore,
|
||||
@@ -919,9 +920,9 @@ class TreeItem(QtWidgets.QTreeWidgetItem):
|
||||
if column == MainPanel.LENGTH_COLUMN:
|
||||
sortkey = self.obj.metadata.length or 0
|
||||
elif column in MainPanel.NAT_SORT_COLUMNS:
|
||||
sortkey = natsort.natkey(self.text(column).lower())
|
||||
sortkey = natsort.natkey(self.text(column))
|
||||
else:
|
||||
sortkey = self.text(column).lower()
|
||||
sortkey = strxfrm(self.text(column))
|
||||
self._sortkeys[column] = sortkey
|
||||
return sortkey
|
||||
|
||||
|
||||
Reference in New Issue
Block a user