From cac15b14f46e6ac69b72a89f43b96ae5ee212b9a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 17 Jun 2022 13:22:34 +0200 Subject: Hangman Demo: Do not crash on non-mobile platforms If we don't get the in-app purchases we can still do some things. Change-Id: I93a1abf3c4cfe0c19cd6d566590ec522db26eecd Reviewed-by: Assam Boudjelthia (cherry picked from commit 7dd98a7b6136d29d3bc8576d940f5e71c941bfbf) Reviewed-by: Qt Cherry-pick Bot --- examples/demos/hangman/purchasing/inapp/inappstore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/demos/hangman/purchasing/inapp/inappstore.cpp b/examples/demos/hangman/purchasing/inapp/inappstore.cpp index acce855c6..698ec0ea3 100644 --- a/examples/demos/hangman/purchasing/inapp/inappstore.cpp +++ b/examples/demos/hangman/purchasing/inapp/inappstore.cpp @@ -35,12 +35,13 @@ InAppStore::~InAppStore() void InAppStore::setupBackend() { - #ifdef Q_OS_ANDROID +#if defined Q_OS_ANDROID d->backend = new AndroidInAppPurchaseBackend; - #endif - #ifdef Q_OS_IOS +#elif defined Q_OS_IOS d->backend = new IosInAppPurchaseBackend; - #endif +#else + return; +#endif d->backend->setStore(this); connect(d->backend, &InAppPurchaseBackend::ready, -- cgit v1.2.3