diff options
| author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-19 15:58:13 +0800 | 
|---|---|---|
| committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-19 15:58:13 +0800 | 
| commit | 3490c318493d6b532fb4eafa4c1973876344b10b (patch) | |
| tree | fd03722641ef7a9320bc96e464193b0c32b996bb | |
| parent | a3da1b34d74f912093bde50998adb92cfa8540ac (diff) | |
Results page implementation
| -rw-r--r-- | client.cxx | 11 | ||||
| -rw-r--r-- | qicclient/client.hxx | 6 | 
2 files changed, 15 insertions, 2 deletions
| @@ -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); |