Sort selection strings without key function

The selection is a list of string so we can sort as-is.

Closes #14883
(grafted from 2d7c2466ae0eda5dc670cc8fd2ee5b386fb704ab)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-06-08 16:19:50 +02:00
parent 6f5c3ec71a
commit ac0e3d842e
@@ -2,7 +2,6 @@
# this repository contains the full copyright notices and license terms.
import datetime
import gettext
import operator
from gi.repository import Gdk, GLib, GObject, Gtk
@@ -629,7 +628,7 @@ class ScreenContainer(object):
elif field['type'] in ['selection', 'multiselection']:
selections = [x[1] for x in field['selection']]
if field.get('sort', True):
selections.sort(key=operator.itemgetter(1))
selections.sort()
entry = Selection(tuple(selections))
entry.set_vexpand(True)
elif field['type'] in ('date', 'datetime', 'time'):