mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 16:27:51 -06:00
Removed redundant string comparison
CURA-7038
This commit is contained in:
parent
75d2a72424
commit
fc504a7cb6
2 changed files with 6 additions and 6 deletions
|
@ -61,7 +61,7 @@ UM.Dialog{
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
property int lineHeight: 60
|
property int lineHeight: 60
|
||||||
visible: model.is_compatible === "True" ? true : false
|
visible: model.is_compatible
|
||||||
height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the compatible packages here
|
height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the compatible packages here
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,7 @@ UM.Dialog{
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
property int lineHeight: 60
|
property int lineHeight: 60
|
||||||
visible: model.is_compatible === "True" ? false : true
|
visible: !model.is_compatible
|
||||||
height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the incompatible packages here
|
height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the incompatible packages here
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,9 +35,9 @@ class SubscribedPackagesModel(ListModel):
|
||||||
continue
|
continue
|
||||||
package = {"name": item["display_name"], "sdk_versions": item["sdk_versions"]}
|
package = {"name": item["display_name"], "sdk_versions": item["sdk_versions"]}
|
||||||
if self._sdk_version not in item["sdk_versions"]:
|
if self._sdk_version not in item["sdk_versions"]:
|
||||||
package.update({"is_compatible": "False"})
|
package.update({"is_compatible": False})
|
||||||
else:
|
else:
|
||||||
package.update({"is_compatible": "True"})
|
package.update({"is_compatible": True})
|
||||||
try:
|
try:
|
||||||
package.update({"icon_url": item["icon_url"]})
|
package.update({"icon_url": item["icon_url"]})
|
||||||
except KeyError: # There is no 'icon_url" in the response payload for this package
|
except KeyError: # There is no 'icon_url" in the response payload for this package
|
||||||
|
@ -50,13 +50,13 @@ class SubscribedPackagesModel(ListModel):
|
||||||
def has_compatible_packages(self):
|
def has_compatible_packages(self):
|
||||||
has_compatible_items = False
|
has_compatible_items = False
|
||||||
for item in self._items:
|
for item in self._items:
|
||||||
if item['is_compatible'] == 'True':
|
if item['is_compatible'] == True:
|
||||||
has_compatible_items = True
|
has_compatible_items = True
|
||||||
return has_compatible_items
|
return has_compatible_items
|
||||||
|
|
||||||
def has_incompatible_packages(self):
|
def has_incompatible_packages(self):
|
||||||
has_incompatible_items = False
|
has_incompatible_items = False
|
||||||
for item in self._items:
|
for item in self._items:
|
||||||
if item['is_compatible'] == 'False':
|
if item['is_compatible'] == False:
|
||||||
has_incompatible_items = True
|
has_incompatible_items = True
|
||||||
return has_incompatible_items
|
return has_incompatible_items
|
Loading…
Add table
Add a link
Reference in a new issue