From 5d4ca393157362cb9e82022c1f66c61a66ad9077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sun, 28 Jun 2020 09:32:04 +0800 Subject: Catalog updates from fellow C++ catalog --- client.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 44fcea6..7f74127 100644 --- a/client.cxx +++ b/client.cxx @@ -1,8 +1,9 @@ #include +#include #include #include #include -#include "qicclient/product.hxx" +#include "qicclient/catalog.hxx" #include "qicclient/client.hxx" namespace ICClient { @@ -23,14 +24,14 @@ namespace ICClient { { icclient_catalog* catalog = nullptr; icclient_results(handler, &catalog, prodGroup.toLatin1().constData()); - emit gotResults(catalog); + if (catalog) emit gotResults(new Catalog{catalog}); } void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) { icclient_catalog* catalog = nullptr; icclient_allproducts(handler, &catalog); - emit gotResults(catalog); + if (catalog) emit gotResults(new Catalog{catalog}); } void Client::flyPage(size_t (*handler)(void* contents, size_t size, @@ -39,7 +40,7 @@ namespace ICClient { { icclient_product* product = nullptr; icclient_flypage(handler, &product, sku.toLatin1().constData()); - if (product) emit gotFlyPage(std::shared_ptr{new Product{product}}); + if (product) emit gotFlyPage(shared_ptr{new Product{product}}); } void Client::order(icclient_ord_order** orderPtr, QString const& sku -- cgit v1.2.3