From c1cc031bd0c7ddcadb5215bb50ec264f81d8411c Mon Sep 17 00:00:00 2001 From: Kerry Ivan Kurian Date: Thu, 20 Sep 2018 14:50:27 -0700 Subject: [PATCH] Remove cruft and refactor --- .../MarketplaceItemTester.qml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml b/interface/resources/qml/hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml index 9927c072db..37d2f2c170 100644 --- a/interface/resources/qml/hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml +++ b/interface/resources/qml/hifi/commerce/marketplaceItemTester/MarketplaceItemTester.qml @@ -45,8 +45,9 @@ Rectangle { function installResourceObj(resourceObj) { if ("application" == resourceObj["assetType"]) { Commerce.installApp(resourceObj["resource"]); + } else { + print("Cannot install resource object type " + resourceObj["assetType"]); } - // XXX support other asset types here } function addAllInstalledAppsToList() { @@ -63,14 +64,16 @@ Rectangle { return httpPattern.test(resource) ? resource : "file:///" + resource; } - function rezEntity(itemHref, itemType) { - + function rezEntity(resource, entityType) { + sendToScript({ + method: 'tester_rezClicked', + itemHref: toUrl(resource), + itemType: entityType}); } Component.onCompleted: { // On startup, list includes all tester-installed assets. addAllInstalledAppsToList(); - // XXX support other asset types here } ListView { @@ -99,21 +102,18 @@ Rectangle { urlHandler.handleUrl("hifi://localhost/0,0,0"); Commerce.replaceContentSet(toUrl(resource), ""); break; - case "entity or wearable": - print("going to rez " + toUrl(resource)); - sendToScript({ - method: 'tester_rezClicked', - itemHref: toUrl(resource), - itemType: "entity"}); + case "entity": + case "wearable": + rezEntity(resource, assetType); break; + default: + print("Marketplace item tester unsupported assetType " + assetType); } - // XXX support other resource types here. }, "trash": function(){ if ("application" == assetType) { Commerce.uninstallApp(resource); } - // XXX support other resource types here. resourceListModel.remove(index); } }