summaryrefslogtreecommitdiff
path: root/interchange.cxx
diff options
context:
space:
mode:
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);
}
-
}