From 33f73fef0df20528ca3867a41d4a1257fc4791f9 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 22 Feb 2018 16:26:35 -0800 Subject: [PATCH] YAY! --- .../resources/qml/hifi/commerce/purchases/Purchases.qml | 6 +----- interface/src/commerce/QmlCommerce.cpp | 9 ++++----- interface/src/commerce/QmlCommerce.h | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 896200a8e6..3612de7323 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -36,7 +36,7 @@ Rectangle { property bool isShowingMyItems: false; property bool isDebuggingFirstUseTutorial: false; property int pendingItemCount: 0; - property var installedApps; + property string installedApps; // Style color: hifi.colors.white; Connections { @@ -63,7 +63,6 @@ Rectangle { } else if (!Settings.getValue("isFirstUseOfPurchases", true) && root.activeView === "initialize") { root.activeView = "purchasesMain"; root.installedApps = Commerce.getInstalledApps(); - console.log("ZRF! " + root.installedApps); Commerce.inventory(); } } else { @@ -688,9 +687,6 @@ Rectangle { var currentId; for (var i = 0; i < tempPurchasesModel.count; i++) { currentId = tempPurchasesModel.get(i).id; - console.log("ZRF HERE 2 " + root.installedApps); - console.log("ZRF HERE 3 " + currentId); - console.log("ZRF HERE 4 " + ((root.installedApps).indexOf(currentId) > -1)); filteredPurchasesModel.append(tempPurchasesModel.get(i)); filteredPurchasesModel.setProperty(i, 'permissionExplanationCardVisible', false); diff --git a/interface/src/commerce/QmlCommerce.cpp b/interface/src/commerce/QmlCommerce.cpp index f80e88d175..6de5de1a9d 100644 --- a/interface/src/commerce/QmlCommerce.cpp +++ b/interface/src/commerce/QmlCommerce.cpp @@ -190,16 +190,15 @@ void QmlCommerce::alreadyOwned(const QString& marketplaceId) { ledger->alreadyOwned(marketplaceId); } -QStringList QmlCommerce::getInstalledApps() { - QStringList installedAppsFromMarketplace; +QString QmlCommerce::getInstalledApps() { + QString installedAppsFromMarketplace; QStringList runningScripts = DependencyManager::get()->getRunningScripts(); QDir directory(_appsPath); - qCDebug(commerce) << "ZRF FIXME" << _appsPath; QStringList apps = directory.entryList(QStringList("*.app.json")); foreach(QString appFileName, apps) { - installedAppsFromMarketplace.append(appFileName); - qCDebug(commerce) << "ZRF FIXME" << appFileName; + installedAppsFromMarketplace += appFileName; + installedAppsFromMarketplace += ","; QFile appFile(_appsPath + appFileName); if (appFile.open(QIODevice::ReadOnly)) { QJsonDocument appFileJsonDocument = QJsonDocument::fromJson(appFile.readAll()); diff --git a/interface/src/commerce/QmlCommerce.h b/interface/src/commerce/QmlCommerce.h index 2bf4959177..09eb7137af 100644 --- a/interface/src/commerce/QmlCommerce.h +++ b/interface/src/commerce/QmlCommerce.h @@ -81,7 +81,7 @@ protected: Q_INVOKABLE void replaceContentSet(const QString& itemHref); - Q_INVOKABLE QStringList getInstalledApps(); + Q_INVOKABLE QString getInstalledApps(); Q_INVOKABLE bool installApp(const QString& appHref); Q_INVOKABLE bool uninstallApp(const QString& appHref); Q_INVOKABLE bool openApp(const QString& appHref);