forked from openlp/openlp
Bug 687638: use locale aware comparison for song list.
This commit is contained in:
parent
0836306f1b
commit
7b608a948a
|
@ -27,7 +27,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import locale
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -40,7 +39,7 @@ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
|
||||||
check_directory_exists
|
check_directory_exists
|
||||||
from openlp.core.lib.ui import UiStrings, create_widget_action
|
from openlp.core.lib.ui import UiStrings, create_widget_action
|
||||||
from openlp.core.lib.settings import Settings
|
from openlp.core.lib.settings import Settings
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation, locale_compare
|
||||||
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
|
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
|
||||||
SongImportForm, SongExportForm
|
SongImportForm, SongExportForm
|
||||||
from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType, \
|
from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType, \
|
||||||
|
@ -263,7 +262,7 @@ class SongMediaItem(MediaManagerItem):
|
||||||
# Sort the songs by its title considering language specific characters.
|
# Sort the songs by its title considering language specific characters.
|
||||||
# lower() is needed for windows!
|
# lower() is needed for windows!
|
||||||
searchresults.sort(
|
searchresults.sort(
|
||||||
cmp=locale.strcoll, key=lambda song: song.title.lower())
|
cmp=locale_compare, key=lambda song: song.title)
|
||||||
for song in searchresults:
|
for song in searchresults:
|
||||||
# Do not display temporary songs
|
# Do not display temporary songs
|
||||||
if song.temporary:
|
if song.temporary:
|
||||||
|
|
Loading…
Reference in New Issue