summaryrefslogtreecommitdiff
path: root/ord.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ord.cxx')
-rw-r--r--ord.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/ord.cxx b/ord.cxx
index 9dfd846..8472361 100644
--- a/ord.cxx
+++ b/ord.cxx
@@ -12,9 +12,14 @@ namespace QInterchange {
Ord::Ord(struct interchange_ord_order *order, QObject *parent) :
QAbstractListModel{parent}
{
- ord = this;
+ init(order);
for (size_t i = 0; i < order->nitems; i++)
addItem(Item{&order->items[i]});
+ }
+
+ void Ord::init(struct interchange_ord_order *order)
+ {
+ ord = this;
m_subtotal = order->subtotal;
m_shipping = order->shipping;
m_totalCost = order->total_cost;