diff options
| author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-28 09:32:04 +0800 |
|---|---|---|
| committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-28 09:32:04 +0800 |
| commit | 5d4ca393157362cb9e82022c1f66c61a66ad9077 (patch) | |
| tree | b5f1cf586c3e3d9a3fba45631e80fe543139428c /client.cxx | |
| parent | 0d2a18b15d45d612f3b9ba92d7b7af23be7d444f (diff) | |
Catalog updates from fellow C++ catalog
Diffstat (limited to 'client.cxx')
| -rw-r--r-- | client.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,8 +1,9 @@ #include <cstddef> +#include <memory> #include <QObject> #include <icclient/client.h> #include <icclient/member.h> -#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<Product>{new Product{product}}); + if (product) emit gotFlyPage(shared_ptr<Product>{new Product{product}}); } void Client::order(icclient_ord_order** orderPtr, QString const& sku |