From d68415c47cc3b2a86fb69dee1392dfe9a89b1647 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 8 Jun 2018 16:47:06 -0700 Subject: [PATCH] code feedback --- interface/resources/qml/hifi/Feed.qml | 21 +------------------ interface/resources/qml/hifi/Pal.qml | 7 +++++-- .../commerce/common/sendAsset/SendAsset.qml | 2 +- .../qml/hifi/commerce/purchases/Purchases.qml | 4 ++-- .../qml/hifi/commerce/wallet/Wallet.qml | 3 ++- .../qml/hifi/commerce/wallet/WalletHome.qml | 3 ++- .../qml/hifi/models/PSFListModel.qml | 2 +- 7 files changed, 14 insertions(+), 28 deletions(-) diff --git a/interface/resources/qml/hifi/Feed.qml b/interface/resources/qml/hifi/Feed.qml index 0b33bac657..d7d469364c 100644 --- a/interface/resources/qml/hifi/Feed.qml +++ b/interface/resources/qml/hifi/Feed.qml @@ -16,7 +16,7 @@ import QtQuick 2.5 import QtGraphicalEffects 1.0 import "toolbars" import "../styles-uit" -import "models" as HifiModels +import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. Column { id: root; @@ -136,23 +136,4 @@ Column { unhoverThunk: function () { hovered = false } } } - /* WTF is this? - NumberAnimation { - id: anim; - target: scroll; - property: "contentX"; - duration: 250; - } - function scrollToIndex(index) { - anim.running = false; - var pos = scroll.contentX; - var destPos; - scroll.positionViewAtIndex(index, ListView.Contain); - destPos = scroll.contentX; - anim.from = pos; - anim.to = destPos; - scroll.currentIndex = index; - anim.running = true; - } - */ } diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 0735c03a77..d9625a68c2 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -18,7 +18,7 @@ import Qt.labs.settings 1.0 import "../styles-uit" import "../controls-uit" as HifiControlsUit import "../controls" as HifiControls -import "models" as HifiModels +import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. // references HMD, Users, UserActivityLogger from root context @@ -1238,7 +1238,10 @@ Rectangle { reloadNearby.color = 2; } break; - case 'inspectionCertificate_resetCert': // HRS FIXME what's this about? + case 'inspectionCertificate_resetCert': + // marketplaces.js sends out a signal to QML with that method when the tablet screen changes and it's not changed to a commerce-related screen. + // We want it to only be handled by the InspectionCertificate.qml, but there's not an easy way of doing that. + // As a part of a "cleanup inspectionCertificate_resetCert" ticket, we'll have to figure out less logspammy way of doing what has to be done. break; case 'http.response': http.handleHttpResponse(message); diff --git a/interface/resources/qml/hifi/commerce/common/sendAsset/SendAsset.qml b/interface/resources/qml/hifi/commerce/common/sendAsset/SendAsset.qml index 26c0a0aefa..1353ceab72 100644 --- a/interface/resources/qml/hifi/commerce/common/sendAsset/SendAsset.qml +++ b/interface/resources/qml/hifi/commerce/common/sendAsset/SendAsset.qml @@ -19,7 +19,7 @@ import "../../../../styles-uit" import "../../../../controls-uit" as HifiControlsUit import "../../../../controls" as HifiControls import "../" as HifiCommerceCommon -import "../../../models" as HifiModels +import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. Item { HifiConstants { id: hifi; } diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 3b37edd51b..ec2798680e 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -16,7 +16,7 @@ import QtQuick 2.5 import "../../../styles-uit" import "../../../controls-uit" as HifiControlsUit import "../../../controls" as HifiControls -import "../../models" as HifiModels +import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. import "../wallet" as HifiWallet import "../common" as HifiCommerceCommon import "../inspectionCertificate" as HifiInspectionCertificate @@ -600,7 +600,7 @@ Rectangle { itemEdition: model.edition_number; numberSold: model.number_sold; limitedRun: model.limited_run; - displayedItemCount: 999// For now (and maybe longer), we're going to display all the edition numbers. + displayedItemCount: 999; // For now (and maybe longer), we're going to display all the edition numbers. cardBackVisible: model.cardBackVisible || false; isInstalled: model.isInstalled || false; wornEntityID: model.wornEntityID; diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index 819b71a4d0..603d7fb676 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -779,7 +779,8 @@ Rectangle { http.handleHttpResponse(message); break; case 'palIsStale': - case 'avatarDisconnected': // HRS FIXME. What are these about? + case 'avatarDisconnected': + // Because we don't have "channels" for sending messages to a specific QML object, the messages are broadcast to all QML Items. If an Item of yours happens to be visible when some script sends a message with a method you don't expect, you'll get "Unrecognized message..." logs. break; default: console.log('Unrecognized message from wallet.js:', JSON.stringify(message)); diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index 9076f10ebc..ed032dd055 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -18,7 +18,7 @@ import QtQuick.Controls 2.2 import "../../../styles-uit" import "../../../controls-uit" as HifiControlsUit import "../../../controls" as HifiControls -import "../../models" as HifiModels +import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. Item { HifiConstants { id: hifi; } @@ -229,6 +229,7 @@ Item { } // Either add to pending, or to result. + // Note that you only see a page of pending stuff until you scroll... data.history.forEach(function (item) { if (item.status === 'pending') { pending.count++; diff --git a/interface/resources/qml/hifi/models/PSFListModel.qml b/interface/resources/qml/hifi/models/PSFListModel.qml index 68acb09b28..95e9e1b79e 100644 --- a/interface/resources/qml/hifi/models/PSFListModel.qml +++ b/interface/resources/qml/hifi/models/PSFListModel.qml @@ -55,7 +55,7 @@ Item { retrievedAtLeastOnePage = false; } - // Processing one page. + // Page processing. // Override to return one property of data, and/or to transform the elements. Must return an array of model elements. property var processPage: function (data) { return data; }