summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.cxx11
-rw-r--r--qicclient/client.hxx6
2 files changed, 15 insertions, 2 deletions
diff --git a/client.cxx b/client.cxx
index e459e27..c7950a8 100644
--- a/client.cxx
+++ b/client.cxx
@@ -15,11 +15,20 @@ namespace ICClient {
icclient_cleanup();
}
+ void Client::results(size_t (*handler)(void* contents, size_t size,
+ size_t nmemb, void* userdata),
+ QString const& prodGroup)
+ {
+ icclient_catalog* catalog = nullptr;
+ icclient_results(handler, &catalog, prodGroup.toLatin1().constData());
+ emit gotResults(catalog);
+ }
+
void Client::allProducts(size_t (*handler)(void*, size_t, size_t, void*))
{
icclient_catalog* catalog = nullptr;
icclient_allproducts(handler, &catalog);
- emit gotAllProducts(catalog);
+ emit gotResults(catalog);
}
void Client::flyPage(size_t (*handler)(void* contents, size_t size,
diff --git a/qicclient/client.hxx b/qicclient/client.hxx
index 1c9d4a2..70c76fc 100644
--- a/qicclient/client.hxx
+++ b/qicclient/client.hxx
@@ -18,6 +18,10 @@ namespace ICClient {
Client(char const* url, char const* certificate = nullptr);
~Client();
+ void results(size_t (*handler)(void* contents,
+ size_t size, size_t nmemb,
+ void* userdata),
+ QString const& prodGroup);
void allProducts(size_t (*handler)(void* contents
, size_t size, size_t nmemb
, void* userdata));
@@ -63,7 +67,7 @@ namespace ICClient {
*/
signals:
- void gotAllProducts(icclient_catalog* catalog);
+ void gotResults(icclient_catalog* catalog);
void gotFlyPage(icclient_product* product);
void ordered(icclient_ord_order* order);
void loggedIn(icclient_user* user);