summaryrefslogtreecommitdiff
path: root/ord.cxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-17 08:08:58 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-17 08:08:58 +0800
commita6cfa494405bef00571ef676ac153c21622946f9 (patch)
tree8e6982254b9c425c6d3ad7d7ec6852aafdd39555 /ord.cxx
parentb93bcd224f57458fb9e2c309db0aa26ca55c37df (diff)
Necessary changes for making Ord & Item derivable
Also make use of superclass Product initialisations for Item.
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;