summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interchange.cxx16
-rw-r--r--interchange.hxx2
2 files changed, 15 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);
}
-
}
diff --git a/interchange.hxx b/interchange.hxx
index 4de1618..4b4f44c 100644
--- a/interchange.hxx
+++ b/interchange.hxx
@@ -70,11 +70,13 @@ namespace QInterchange {
void gotCatalog(QString const& response);
void gotProduct(QString const& response);
void gotPage(QString const& response);
+ void gotOrder(QString const& response);
protected:
void emitCatalog(QString const& response);
void emitProduct(QString const& response);
void emitPage(QString const& response);
+ void emitOrder(QString const& response);
};
}