Ignore 'the' prefix when sorting - fixes #204

This commit is contained in:
kramo
2023-10-20 15:28:33 +02:00
parent 38bed27c61
commit 2cd670fcfe

View File

@@ -413,9 +413,11 @@ class CartridgesWindow(Adw.ApplicationWindow):
order = False order = False
def get_value(index: int) -> str: def get_value(index: int) -> str:
return str( return (
getattr((child1.get_child(), child2.get_child())[index], var) str(getattr((child1.get_child(), child2.get_child())[index], var))
).lower() .lower()
.removeprefix("the ")
)
if var != "name" and get_value(0) == get_value(1): if var != "name" and get_value(0) == get_value(1):
var, order = "name", False var, order = "name", False