From 552b14eeda6fc65c6246224425a03a4bf1b31154 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: Fri, 27 Sep 2019 08:55:15 +0800 Subject: Adjust with the new allproducts function name --- client.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 0443ce3..8e169a2 100644 --- a/client.cxx +++ b/client.cxx @@ -1,3 +1,4 @@ +#include #include #include "qicclient/client.hxx" @@ -13,11 +14,11 @@ namespace ICClient { icclient_cleanup(); } - void Client::productAll(icclient_catalog** catalogptr + void Client::allProducts(icclient_catalog** catalogptr , size_t (*callback)(void*, size_t, size_t, void*)) { - icclient_product_all(catalogptr, callback); - emit gotProductAll(*catalogptr); + icclient_allproducts(catalogptr, callback); + emit gotAllProducts(*catalogptr); } void Client::logIn(QString const& username, QString const& password) -- cgit v1.2.3 From bffd7c68508f793fc00c7453850668f7c654e1d0 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: Sat, 28 Sep 2019 13:05:03 +0800 Subject: The app should be able to accept the catalog in QICClient's form --- client.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 8e169a2..4e832ce 100644 --- a/client.cxx +++ b/client.cxx @@ -14,11 +14,11 @@ namespace ICClient { icclient_cleanup(); } - void Client::allProducts(icclient_catalog** catalogptr - , size_t (*callback)(void*, size_t, size_t, void*)) + void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) { - icclient_allproducts(catalogptr, callback); - emit gotAllProducts(*catalogptr); + icclient_catalog* catalog = nullptr; + icclient_allproducts(&catalog, handler); + emit gotAllProducts(catalog); } void Client::logIn(QString const& username, QString const& password) -- cgit v1.2.3 From 73851e44295b0a1e1963689036a0f60c4cbb8330 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: Sat, 28 Sep 2019 15:54:09 +0800 Subject: Client triggers catalog to update directly since getting all products would only be good for catalog. Besides, emitting there seems to cause crash somehow. --- client.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 4e832ce..168a0fc 100644 --- a/client.cxx +++ b/client.cxx @@ -14,11 +14,13 @@ namespace ICClient { icclient_cleanup(); } - void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) + void Client::allProducts(Catalog* qCatalog, size_t (*handler)(void*, size_t + , size_t, void*)) { icclient_catalog* catalog = nullptr; icclient_allproducts(&catalog, handler); - emit gotAllProducts(catalog); + if (catalog) qCatalog->update(catalog); + icclient_product_freecatalog(catalog); } void Client::logIn(QString const& username, QString const& password) -- cgit v1.2.3 From 0640cec9e13edd30b85c50da9943f6fb56aec0df 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, 29 Sep 2019 07:40:23 +0800 Subject: Revert "Client triggers catalog to update directly" This reverts commit 73851e44295b0a1e1963689036a0f60c4cbb8330. --- client.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 168a0fc..4e832ce 100644 --- a/client.cxx +++ b/client.cxx @@ -14,13 +14,11 @@ namespace ICClient { icclient_cleanup(); } - void Client::allProducts(Catalog* qCatalog, size_t (*handler)(void*, size_t - , size_t, void*)) + void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) { icclient_catalog* catalog = nullptr; icclient_allproducts(&catalog, handler); - if (catalog) qCatalog->update(catalog); - icclient_product_freecatalog(catalog); + emit gotAllProducts(catalog); } void Client::logIn(QString const& username, QString const& password) -- cgit v1.2.3 From 0f63d288930a71e9705ce1b48a5e0036a9161b52 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, 29 Sep 2019 08:51:06 +0800 Subject: Swap allproducts arguments --- client.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client.cxx') diff --git a/client.cxx b/client.cxx index 4e832ce..7ffe780 100644 --- a/client.cxx +++ b/client.cxx @@ -17,7 +17,7 @@ namespace ICClient { void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*)) { icclient_catalog* catalog = nullptr; - icclient_allproducts(&catalog, handler); + icclient_allproducts(handler, &catalog); emit gotAllProducts(catalog); } -- cgit v1.2.3