mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Sort profile models case-insensitively
Cast every sorting key to uppercase before doing this. Don't cast to lowercase or there will be problems with characters that don't have lowercase and with Turkish dotted i vs. undotted i. Fixes #3460.
This commit is contained in:
parent
3550ef80e0
commit
d8853b8a98
6 changed files with 9 additions and 9 deletions
|
@ -122,17 +122,17 @@ class BrandMaterialsModel(ListModel):
|
|||
material_type_item["colors"].clear()
|
||||
|
||||
# Sort materials by name
|
||||
material_list = sorted(material_list, key = lambda x: x["name"])
|
||||
material_list = sorted(material_list, key = lambda x: x["name"].upper())
|
||||
material_type_item["colors"].setItems(material_list)
|
||||
|
||||
material_type_item_list.append(material_type_item)
|
||||
|
||||
# Sort material type by name
|
||||
material_type_item_list = sorted(material_type_item_list, key = lambda x: x["name"])
|
||||
material_type_item_list = sorted(material_type_item_list, key = lambda x: x["name"].upper())
|
||||
brand_item["materials"].setItems(material_type_item_list)
|
||||
|
||||
brand_item_list.append(brand_item)
|
||||
|
||||
# Sort brand by name
|
||||
brand_item_list = sorted(brand_item_list, key = lambda x: x["name"])
|
||||
brand_item_list = sorted(brand_item_list, key = lambda x: x["name"].upper())
|
||||
self.setItems(brand_item_list)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue