Browse Source

Apply suggestions from code review

CURA-8762

Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com>

Jaime van Kessel 3 years ago
parent
commit
19e43e8b66

+ 5 - 8
plugins/Marketplace/resources/qml/PackageCardHeader.qml

@@ -36,19 +36,16 @@ Item
         sourceSize.width: width
         source:
         {
-            if(packageData.iconUrl != "")
+            if (packageData.iconUrl != "")
             {
                 return packageData.iconUrl
             }
-            if(packageData.packageType == "plugin")
+            switch (packageData.packageType)
             {
-                return "../images/Plugin.svg"
+                case "plugin": return "../images/Plugin.svg";
+                case "material": return "../images/Spool.svg";
+                default: return "../images/placeholder.svg";
             }
-            if(packageData.packageType == "material")
-            {
-                return "../images/Spool.svg"
-            }
-            return "../images/placeholder.svg"
         }
     }
 

+ 1 - 1
plugins/Marketplace/resources/qml/Packages.qml

@@ -84,7 +84,7 @@ ListView
             manageableInListView: packages.packagesManageableInListView
             packageData: model.package
             width: {
-                if(verticalScrollBar.visible)
+                if (verticalScrollBar.visible)
                 {
                     return parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("default_margin").width
                 }