Exemplo n.º 1
0
/*!
  This slot is called when a signal is emitted by the IAP client to indicate
  that the product data has been received.
*/
void IAPurchase::productDataReceived(int requestId,
                                     QString status,
                                     IAPClient::ProductDataHash productData)
{
    if (QString::compare(status, "OK", Qt::CaseInsensitive) == 0) {
        // Find product request from our cache
        Product *product = productFromCacheByRequestId(requestId);
        if (product) {
            // Store product data from the Store to the data from the back-end.
            product->setProductData(productData);
            emit productDataRead(product);
        }
        else {
            emit productDataReadError();
        }
    }
    else {
        emit productDataReadError();
    }
}