From 560a47463ec705715b4ce5f53a39030feb48e305 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: Tue, 22 Oct 2019 18:08:56 +0800 Subject: order is not a slot and takes a catalog argument --- catalog.cxx | 1 - client.cxx | 6 ++++++ libicclient | 2 +- qicclient/client.hxx | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/catalog.cxx b/catalog.cxx index ecc01a0..8cdc64a 100644 --- a/catalog.cxx +++ b/catalog.cxx @@ -57,7 +57,6 @@ namespace ICClient { if (catalog) { for (size_t i = 0; i < catalog->length; i++) addProduct(Product{catalog->products[i]}); - icclient_freecatalog(catalog); emit updated(); } } diff --git a/client.cxx b/client.cxx index 7ffe780..d3146ce 100644 --- a/client.cxx +++ b/client.cxx @@ -21,6 +21,12 @@ namespace ICClient { emit gotAllProducts(catalog); } + void Client::order(QString const& sku, icclient_catalog* catalog) + { + icclient_ord_order* order = nullptr; + icclient_order(&order, sku.toLatin1().constData(), catalog); + } + void Client::logIn(QString const& username, QString const& password) { icclient_login(username.toLatin1().constData() diff --git a/libicclient b/libicclient index 6fa0df3..e8ae8fb 160000 --- a/libicclient +++ b/libicclient @@ -1 +1 @@ -Subproject commit 6fa0df3c46986b15dec3be672f41eb7ea62c20ef +Subproject commit e8ae8fbeab89beb43138e26465965d3510edd1c7 diff --git a/qicclient/client.hxx b/qicclient/client.hxx index 6121c5e..470018a 100644 --- a/qicclient/client.hxx +++ b/qicclient/client.hxx @@ -19,10 +19,10 @@ namespace ICClient { void allProducts(size_t (*handler)(void* contents , size_t size, size_t nmemb , void* userdata)); + void order(QString const& sku, icclient_catalog* catalog); public slots: /* - void order(QString const& sku); void remove(unsigned int const& indices); void checkout(); */ -- cgit v1.2.3