Browse Source

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.
Ghostkeeper 4 years ago
parent
commit
27185c268d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      plugins/Toolbox/src/PackagesModel.py

+ 2 - 2
plugins/Toolbox/src/PackagesModel.py

@@ -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.
 
 import re
@@ -91,7 +91,7 @@ class PackagesModel(ListModel):
             items.append({
                 "id":                   package["package_id"],
                 "type":                 package["package_type"],
-                "name":                 package["display_name"],
+                "name":                 package["display_name"].strip(),
                 "version":              package["package_version"],
                 "author_id":            package["author"]["author_id"],
                 "author_name":          package["author"]["display_name"],