mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-19 01:31:28 +02:00
Remove cruft and refactor
This commit is contained in:
parent
ae4352f450
commit
c1cc031bd0
1 changed files with 12 additions and 12 deletions
|
@ -45,8 +45,9 @@ Rectangle {
|
||||||
function installResourceObj(resourceObj) {
|
function installResourceObj(resourceObj) {
|
||||||
if ("application" == resourceObj["assetType"]) {
|
if ("application" == resourceObj["assetType"]) {
|
||||||
Commerce.installApp(resourceObj["resource"]);
|
Commerce.installApp(resourceObj["resource"]);
|
||||||
|
} else {
|
||||||
|
print("Cannot install resource object type " + resourceObj["assetType"]);
|
||||||
}
|
}
|
||||||
// XXX support other asset types here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAllInstalledAppsToList() {
|
function addAllInstalledAppsToList() {
|
||||||
|
@ -63,14 +64,16 @@ Rectangle {
|
||||||
return httpPattern.test(resource) ? resource : "file:///" + resource;
|
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: {
|
Component.onCompleted: {
|
||||||
// On startup, list includes all tester-installed assets.
|
// On startup, list includes all tester-installed assets.
|
||||||
addAllInstalledAppsToList();
|
addAllInstalledAppsToList();
|
||||||
// XXX support other asset types here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
@ -99,21 +102,18 @@ Rectangle {
|
||||||
urlHandler.handleUrl("hifi://localhost/0,0,0");
|
urlHandler.handleUrl("hifi://localhost/0,0,0");
|
||||||
Commerce.replaceContentSet(toUrl(resource), "");
|
Commerce.replaceContentSet(toUrl(resource), "");
|
||||||
break;
|
break;
|
||||||
case "entity or wearable":
|
case "entity":
|
||||||
print("going to rez " + toUrl(resource));
|
case "wearable":
|
||||||
sendToScript({
|
rezEntity(resource, assetType);
|
||||||
method: 'tester_rezClicked',
|
|
||||||
itemHref: toUrl(resource),
|
|
||||||
itemType: "entity"});
|
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
print("Marketplace item tester unsupported assetType " + assetType);
|
||||||
}
|
}
|
||||||
// XXX support other resource types here.
|
|
||||||
},
|
},
|
||||||
"trash": function(){
|
"trash": function(){
|
||||||
if ("application" == assetType) {
|
if ("application" == assetType) {
|
||||||
Commerce.uninstallApp(resource);
|
Commerce.uninstallApp(resource);
|
||||||
}
|
}
|
||||||
// XXX support other resource types here.
|
|
||||||
resourceListModel.remove(index);
|
resourceListModel.remove(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue