From 9b5135b66b84cc6026a0630e97b0999dbb309d2c Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Thu, 21 Jun 2018 22:37:03 +0300 Subject: [PATCH] remove debug outputs per Dante's request --- interface/resources/qml/hifi/AvatarApp.qml | 49 ------------------- .../qml/hifi/avatarapp/AdjustWearables.qml | 31 ------------ .../qml/hifi/avatarapp/AvatarsModel.qml | 24 +-------- 3 files changed, 1 insertion(+), 103 deletions(-) diff --git a/interface/resources/qml/hifi/AvatarApp.qml b/interface/resources/qml/hifi/AvatarApp.qml index b7d6b12ed1..2cc6189e11 100644 --- a/interface/resources/qml/hifi/AvatarApp.qml +++ b/interface/resources/qml/hifi/AvatarApp.qml @@ -33,7 +33,6 @@ Rectangle { signal sendToScript(var message); function emitSendToScript(message) { - console.debug('AvatarApp.qml: emitting sendToScript: ', JSON.stringify(message, null, '\t')); sendToScript(message); } @@ -56,9 +55,7 @@ Rectangle { xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState === XMLHttpRequest.DONE && xmlhttp.status === 200) { try { - console.debug('xmlhttp: ', xmlhttp.status, 'got responseText: ', xmlhttp.responseText); var marketResponse = JSON.parse(xmlhttp.responseText.trim()) - console.debug('got market response: ', JSON.stringify(marketResponse)); if(marketResponse.status === 'success') { avatar.modelName = marketResponse.data.title; @@ -74,7 +71,6 @@ Rectangle { } function getAvatarModelName() { - console.debug('executing getAvatarModelName()'); if(currentAvatar === null) { return ''; @@ -100,19 +96,13 @@ Rectangle { property int avatarWearablesCount: currentAvatar ? currentAvatar.wearables.count : 0 property var currentAvatar: null; function setCurrentAvatar(avatar, bookmarkName) { - var currentAvatarObject = allAvatars.makeAvatarObject(avatar, bookmarkName); currentAvatar = currentAvatarModel.makeAvatarEntry(currentAvatarObject); - - console.debug('AvatarApp.qml: currentAvatarObject: ', currentAvatarObject, 'currentAvatar: ', currentAvatar, JSON.stringify(currentAvatar.wearables, 0, 4)); - console.debug('currentAvatar.wearables: ', currentAvatar.wearables); } property url externalAvatarThumbnailUrl: '../../images/avatarapp/guy-in-circle.svg' function fromScript(message) { - console.debug('AvatarApp.qml: fromScript: ', JSON.stringify(message, null, '\t')) - if(message.method === 'initialize') { jointNames = message.data.jointNames; emitSendToScript({'method' : getAvatarsMethod}); @@ -129,12 +119,10 @@ Rectangle { currentAvatar.avatarScale = message.value; updateCurrentAvatarInBookmarks(currentAvatar); } else if(message.method === 'externalAvatarApplied') { - console.debug('externalAvatarApplied...'); currentAvatar.avatarUrl = message.avatarURL; currentAvatar.thumbnailUrl = allAvatars.makeThumbnailUrl(message.avatarURL); currentAvatar.entry.avatarUrl = currentAvatar.avatarUrl; currentAvatar.modelName = undefined; - console.debug('externalAvatarApplied: ', currentAvatar.avatarUrl, currentAvatar.thumbnailUrl); updateCurrentAvatarInBookmarks(currentAvatar); } else if(message.method === 'settingChanged') { currentAvatarSettings[message.name] = message.value; @@ -164,8 +152,6 @@ Rectangle { var index = pageOfAvatars.findAvatarIndex(message.name); var absoluteIndex = view.currentPage * view.itemsPerPage + index - console.debug('removed ', absoluteIndex, 'view.currentPage', view.currentPage, - 'view.itemsPerPage: ', view.itemsPerPage, 'index', index, 'pageOfAvatars', pageOfAvatars, 'pageOfAvatars.count', pageOfAvatars) allAvatars.remove(absoluteIndex) pageOfAvatars.remove(index); @@ -173,8 +159,6 @@ Rectangle { var itemsOnPage = pageOfAvatars.count; var newItemIndex = view.currentPage * view.itemsPerPage + itemsOnPage; - console.debug('newItemIndex: ', newItemIndex, 'allAvatars.count - 1: ', allAvatars.count - 1, 'pageOfAvatars.count:', pageOfAvatars.count); - if(newItemIndex <= (allAvatars.count - 1)) { pageOfAvatars.append(allAvatars.get(newItemIndex)); } else { @@ -182,7 +166,6 @@ Rectangle { pageOfAvatars.appendGetAvatars(); } - console.debug('removed ', absoluteIndex, 'newItemIndex: ', newItemIndex, 'allAvatars.count:', allAvatars.count, 'pageOfAvatars.count:', pageOfAvatars.count) pageOfAvatars.isUpdating = false; } else if(message.method === getAvatarsMethod) { var getAvatarsData = message.data; @@ -191,7 +174,6 @@ Rectangle { displayNameInput.text = getAvatarsData.displayName; currentAvatarSettings = getAvatarsData.currentAvatarSettings; - console.debug('currentAvatar: ', JSON.stringify(currentAvatar, null, '\t')); updateCurrentAvatarInBookmarks(currentAvatar); } else if(message.method === 'updateAvatarInBookmarks') { updateCurrentAvatarInBookmarks(currentAvatar); @@ -201,16 +183,11 @@ Rectangle { } function updateCurrentAvatarInBookmarks(avatar) { - console.debug('searching avatar in bookmarks... '); - var bookmarkAvatarIndex = allAvatars.findAvatarIndexByValue(avatar); - if(bookmarkAvatarIndex === -1) { - console.debug('bookmarkAvatarIndex = -1, avatar is not favorite') avatar.name = ''; view.setPage(0); } else { - console.debug('bookmarkAvatarIndex = ', bookmarkAvatarIndex, 'avatar is among favorites!') var bookmarkAvatar = allAvatars.get(bookmarkAvatarIndex); avatar.name = bookmarkAvatar.name; view.selectAvatar(bookmarkAvatar); @@ -282,7 +259,6 @@ Rectangle { } onScaleChanged: { - console.debug('AvatarApp.qml: onScaleChanged: ', scale); emitSendToScript({'method' : 'setScale', 'avatarScale' : scale}) } } @@ -434,7 +410,6 @@ Rectangle { onClicked: { createFavorite.onSaveClicked = function() { var entry = currentAvatar.entry; - console.debug('was: ', JSON.stringify(entry, 0, 4)); var wearables = []; for(var i = 0; i < currentAvatar.wearables.count; ++i) { @@ -443,7 +418,6 @@ Rectangle { entry.avatarEntites = wearables; currentAvatar.name = createFavorite.favoriteNameText; - console.debug('became: ', JSON.stringify(entry, 0, 4)); emitSendToScript({'method': 'addAvatar', 'name' : currentAvatar.name}); createFavorite.close(); @@ -500,7 +474,6 @@ Rectangle { var url = popup.inputText.text; emitSendToScript({'method' : 'applyExternalAvatar', 'avatarURL' : url}) }, function(link) { - console.debug('link clicked', link); Qt.openUrlExternally(link); }); } @@ -517,7 +490,6 @@ Rectangle { MouseArea { anchors.fill: parent onClicked: { - console.debug('adjustWearables.open'); adjustWearables.open(currentAvatar); } } @@ -537,7 +509,6 @@ Rectangle { popup.showGetWearables(function() { emitSendToScript({'method' : 'navigate', 'url' : 'hifi://AvatarIsland/11.5848,-8.10862,-2.80195'}) }, function(link) { - console.debug('link clicked', link); emitSendToScript({'method' : 'navigate', 'url' : link}) }); } @@ -618,25 +589,13 @@ Rectangle { property int itemsPerPage: 8 property int totalPages: Math.ceil((allAvatars.count + 1) / itemsPerPage) - onTotalPagesChanged: { - console.debug('total pages: ', totalPages) - } - property int currentPage: 0; onCurrentPageChanged: { - console.debug('currentPage: ', currentPage) currentIndex = Qt.binding(currentAvatarIndexInBookmarksPage); } property bool hasNext: currentPage < (totalPages - 1) - onHasNextChanged: { - console.debug('hasNext: ', hasNext) - } - property bool hasPrev: currentPage > 0 - onHasPrevChanged: { - console.debug('hasPrev: ', hasPrev) - } function setPage(pageIndex) { pageOfAvatars.isUpdating = true; @@ -646,7 +605,6 @@ Rectangle { for(var itemIndex = 0; start < end; ++start, ++itemIndex) { var avatarItem = allAvatars.get(start) - console.debug('getting ', start, avatarItem) pageOfAvatars.append(avatarItem); } @@ -654,7 +612,6 @@ Rectangle { pageOfAvatars.appendGetAvatars(); currentPage = pageIndex; - console.debug('switched to the page with', pageOfAvatars.count, 'items') pageOfAvatars.isUpdating = false; } @@ -675,7 +632,6 @@ Rectangle { function removeGetAvatars() { if(hasGetAvatars()) { remove(count - 1) - console.debug('removed get avatars...'); } } } @@ -721,12 +677,8 @@ Rectangle { border.color: container.highlighted ? style.colors.blueHighlight : 'transparent' border.width: container.highlighted ? 4 : 0 wearablesCount: { - console.debug('getMoreAvatars: ', getMoreAvatars, 'name: ', name); return !getMoreAvatars ? wearables.count : 0 } - onWearablesCountChanged: { - console.debug('delegate: AvatarThumbnail.wearablesCount: ', wearablesCount) - } visible: !getMoreAvatars @@ -793,7 +745,6 @@ Rectangle { popup.showBuyAvatars(function() { emitSendToScript({'method' : 'navigate', 'url' : 'hifi://BodyMart'}) }, function(link) { - console.debug('link clicked', link); emitSendToScript({'method' : 'navigate', 'url' : link}) }); } diff --git a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml index 01f4f63219..b487f201dc 100644 --- a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml +++ b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml @@ -23,17 +23,11 @@ Rectangle { modified = false; } - onModifiedChanged: { - console.debug('modified: ', modified) - } - property var jointNames; property string avatarName: '' property var wearablesModel; function open(avatar) { - console.debug('AdjustWearables.qml: open: *', JSON.stringify(avatar, null, '\t')); - adjustWearablesOpened(avatar.name); visible = true; @@ -43,21 +37,12 @@ Rectangle { } function refresh(avatar) { - console.debug('refresh: '); - for(var i = 0; i < avatar.wearables.count; ++i) { - console.debug('wearable: ', avatar.wearables.get(i).properties.id); - } - wearablesCombobox.model.clear(); - console.debug('AdjustWearables.qml: open: avatar.wearables.count: ', avatar.wearables.count); for(var i = 0; i < avatar.wearables.count; ++i) { var wearable = avatar.wearables.get(i).properties; - console.debug('wearable: ', JSON.stringify(wearable, null, '\t')) - for(var j = (wearable.modelURL.length - 1); j >= 0; --j) { if(wearable.modelURL[j] === '/') { wearable.text = wearable.modelURL.substring(j + 1) + ' [%jointIndex%]'.replace('%jointIndex%', jointNames[wearable.parentJointIndex]); - console.debug('wearable.text = ', wearable.text); break; } } @@ -73,7 +58,6 @@ Rectangle { } var wearable = wearablesCombobox.model.get(wearableIndex); - console.debug('refreshWearable: ', wearableID, JSON.stringify(wearable, 0, 4)); if(!wearable) { return; @@ -82,10 +66,6 @@ Rectangle { var wearableModelItemProperties = wearablesModel.get(wearableIndex).properties; for(var prop in properties) { - console.debug('updated wearable', prop, - 'old = ', JSON.stringify(wearable[prop], 0, 4), - 'new = ', JSON.stringify(properties[prop], 0, 4)); - wearable[prop] = properties[prop]; wearableModelItemProperties[prop] = wearable[prop]; @@ -100,10 +80,7 @@ Rectangle { } } - console.debug('wearableModelItemProperties: ', JSON.stringify(wearableModelItemProperties, 0, 4)) - wearablesModel.setProperty(wearableIndex, 'properties', wearableModelItemProperties); - console.debug('wearablesModel.get(wearableIndex).properties: ', JSON.stringify(wearablesModel.get(wearableIndex).properties, 0, 4)) } function getCurrentWearable() { @@ -165,8 +142,6 @@ Rectangle { } comboBox.onCurrentIndexChanged: { - console.debug('wearable index changed: ', currentIndex); - var currentWearable = getCurrentWearable(); if(currentWearable) { @@ -207,8 +182,6 @@ Rectangle { yvalue = localPosition.y zvalue = localPosition.z notify = true; - - console.debug('position.set: localPosition = ', JSON.stringify(localPosition, 0, 4)) } function notifyPositionChanged() { @@ -261,8 +234,6 @@ Rectangle { yvalue = localRotationAngles.y zvalue = localRotationAngles.z notify = true; - - console.debug('localRotationAngles = ', JSON.stringify(localRotationAngles, 0, 4)) } function notifyRotationChanged() { @@ -317,8 +288,6 @@ Rectangle { notify = false; realValue = value notify = true; - - console.debug('scale = ', realValue) } function notifyScaleChanged() { diff --git a/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml b/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml index 8ba030b36e..58913b2b00 100644 --- a/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml +++ b/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml @@ -8,9 +8,7 @@ ListModel { var regexp = new RegExp(guidRegexp,["i"]); var match = regexp.exec(avatarUrl); - if (match !== null) - { - console.debug('marketplaceId guid', match[1]); + if (match !== null) { return match[1]; } @@ -36,10 +34,7 @@ ListModel { } function makeAvatarObject(avatar, avatarName) { - console.debug('makeAvatarEntry: ', avatarName, JSON.stringify(avatar)); - var avatarThumbnailUrl = makeThumbnailUrl(avatar.avatarUrl); - console.debug('avatarThumbnailUrl:', avatarThumbnailUrl); return { 'name' : avatarName, @@ -55,8 +50,6 @@ ListModel { } function addAvatarEntry(avatar, avatarName) { - console.debug('addAvatarEntry: ', avatarName); - var avatarEntry = makeAvatarObject(avatar, avatarName); append(avatarEntry); @@ -138,8 +131,6 @@ ListModel { } function compareObjects(o1, o2, props, arrayProp) { - - console.debug('compare ojects: o1 = ', JSON.stringify(o1, null, 4), 'o2 = ', JSON.stringify(o2, null, 4)); for(var i = 0; i < props.length; ++i) { var prop = props[i]; var propertyName = prop.propertyName; @@ -148,21 +139,13 @@ ListModel { var o1Value = arrayProp ? o1[arrayProp][propertyName] : o1[propertyName]; var o2Value = arrayProp ? o2[arrayProp][propertyName] : o2[propertyName]; - console.debug('compare values for key: ', propertyName, comparer ? 'using specified comparer' : 'using default comparer', ', o1 = ', JSON.stringify(o1Value, null, 4), 'o2 = ', JSON.stringify(o2Value, null, 4)); - if(comparer) { if(comparer(o1Value, o2Value) === false) { - console.debug('comparer: not equal'); return false; - } else { - console.debug('comparer: equal'); } } else { if(JSON.stringify(o1Value) !== JSON.stringify(o2Value)) { - console.debug('not equal'); return false; - } else { - console.debug('equal'); } } } @@ -192,10 +175,8 @@ ListModel { function findAvatarIndexByValue(avatar) { var index = -1; - console.debug('findAvatarIndexByValue: ', 'name = ', avatar.name); // 2DO: find better way of determining selected avatar in bookmarks - console.debug('allAvatars.count: ', allAvatars.count); for(var i = 0; i < allAvatars.count; ++i) { var thesame = true; var bookmarkedAvatar = allAvatars.get(i); @@ -226,7 +207,6 @@ ListModel { function findAvatarIndex(avatarName) { for(var i = 0; i < count; ++i) { if(get(i).name === avatarName) { - console.debug('avatar found by index: ', i) return i; } } @@ -234,8 +214,6 @@ ListModel { } function findAvatar(avatarName) { - console.debug('AvatarsModel: find avatar by', avatarName); - var avatarIndex = findAvatarIndex(avatarName); if(avatarIndex === -1) return undefined;