This commit is contained in:
Zach Fox 2018-02-22 16:26:35 -08:00
parent 10fa3fa346
commit 33f73fef0d
3 changed files with 6 additions and 11 deletions

View file

@ -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);

View file

@ -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<ScriptEngines>()->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());

View file

@ -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);