Strip whitespace around package name for display

The actual package name internally will still have the spaces.
People were using this to get ahead in the sorting of packages, which is a little unfair. This doesn't make that impossible, but prevents it for the most part.
This commit is contained in:
Ghostkeeper 2021-03-31 16:10:36 +02:00
parent 7cf2ebe441
commit 27185c268d
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -1,4 +1,4 @@
# Copyright (c) 2018 Ultimaker B.V. # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
import re import re
@ -91,7 +91,7 @@ class PackagesModel(ListModel):
items.append({ items.append({
"id": package["package_id"], "id": package["package_id"],
"type": package["package_type"], "type": package["package_type"],
"name": package["display_name"], "name": package["display_name"].strip(),
"version": package["package_version"], "version": package["package_version"],
"author_id": package["author"]["author_id"], "author_id": package["author"]["author_id"],
"author_name": package["author"]["display_name"], "author_name": package["author"]["display_name"],