summaryrefslogtreecommitdiff
path: root/interchange.cxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-09 12:11:02 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-09 12:11:02 +0800
commit18cd0a85f48ff6a7cf05311c42c7bb1a39f77988 (patch)
tree77df4f84dc6844511e15cd18380d7aa71fc88f84 /interchange.cxx
parent97dc735de7a67e6be77c0cad5164267b2c39c4c1 (diff)
Order signal
Diffstat (limited to 'interchange.cxx')
-rw-r--r--interchange.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/interchange.cxx b/interchange.cxx
index 5b39309..f0141d6 100644
--- a/interchange.cxx
+++ b/interchange.cxx
@@ -73,11 +73,21 @@ namespace QInterchange {
emit gotPage(response);
}
- void Interchange::order(QString const& sku, Catalog const& catalog, Ord& order)
+ void Interchange::emitOrder(QString const& response)
+ {
+ emit gotOrder(response);
+ }
+
+ void Interchange::order(QString const& sku, Catalog const& catalog,
+ Ord& order)
{
auto c_order = order.data();
- interchange_ord_order(sku.toLatin1().constData(), catalog.constData(), &c_order);
+ interchange_ord_order(sku.toLatin1().constData(),
+ catalog.constData(), &c_order,
+ [](interchange_response* response) {
+ interchange->emitOrder(QString{response->data});
+ interchange_free_response(response);
+ });
order.setData(c_order);
}
-
}