From 6f5028080bfddd89c91cd33438dd23724623e919 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 8 Dec 2017 18:23:23 -0800 Subject: [PATCH] Remove useless Wallet.buy() scripting endpoint --- .../scripting/WalletScriptingInterface.cpp | 28 ------------------- .../src/scripting/WalletScriptingInterface.h | 2 -- 2 files changed, 30 deletions(-) diff --git a/interface/src/scripting/WalletScriptingInterface.cpp b/interface/src/scripting/WalletScriptingInterface.cpp index 99fdd5fbde..8b4279af02 100644 --- a/interface/src/scripting/WalletScriptingInterface.cpp +++ b/interface/src/scripting/WalletScriptingInterface.cpp @@ -22,31 +22,3 @@ void WalletScriptingInterface::refreshWalletStatus() { auto wallet = DependencyManager::get(); wallet->getWalletStatus(); } - -static const QString CHECKOUT_QML_PATH = qApp->applicationDirPath() + "../../../qml/hifi/commerce/checkout/Checkout.qml"; -void WalletScriptingInterface::buy(const QString& name, const QString& id, const int& price, const QString& href) { - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "buy", Q_ARG(const QString&, name), Q_ARG(const QString&, id), Q_ARG(const int&, price), Q_ARG(const QString&, href)); - return; - } - - auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); - - tablet->loadQMLSource(CHECKOUT_QML_PATH); - DependencyManager::get()->openTablet(); - - QQuickItem* root = nullptr; - if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !qApp->isHMDMode())) { - root = DependencyManager::get()->getRootItem(); - } else { - root = tablet->getTabletRoot(); - } - CheckoutProxy* checkout = new CheckoutProxy(root->findChild("checkout")); - - // Example: Wallet.buy("Test Flaregun", "0d90d21c-ce7a-4990-ad18-e9d2cf991027", 17, "http://mpassets.highfidelity.com/0d90d21c-ce7a-4990-ad18-e9d2cf991027-v1/flaregun.json"); - checkout->writeProperty("itemName", name); - checkout->writeProperty("itemId", id); - checkout->writeProperty("itemPrice", price); - checkout->writeProperty("itemHref", href); -} \ No newline at end of file diff --git a/interface/src/scripting/WalletScriptingInterface.h b/interface/src/scripting/WalletScriptingInterface.h index 038c580197..d7f9d9242e 100644 --- a/interface/src/scripting/WalletScriptingInterface.h +++ b/interface/src/scripting/WalletScriptingInterface.h @@ -41,8 +41,6 @@ public: Q_INVOKABLE uint getWalletStatus() { return _walletStatus; } void setWalletStatus(const uint& status) { _walletStatus = status; } - Q_INVOKABLE void buy(const QString& name, const QString& id, const int& price, const QString& href); - signals: void walletStatusChanged(); void walletNotSetup();