diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-06-16 15:40:24 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-06-16 15:40:24 +0800 |
commit | 4c43c27774cfc3652ff3269519ee248e71b58185 (patch) | |
tree | be2c03a23347033a16926e236d0af93d8ca27d7f /interchange/ord.hxx | |
parent | d0a8570fd5c46ad2cab21af0b8f5a299bcbc1792 (diff) |
Item is now a subclass of Product
Diffstat (limited to 'interchange/ord.hxx')
-rw-r--r-- | interchange/ord.hxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/interchange/ord.hxx b/interchange/ord.hxx index 34ff202..a7e41a7 100644 --- a/interchange/ord.hxx +++ b/interchange/ord.hxx @@ -8,22 +8,23 @@ namespace QInterchange { - struct Item + struct Item : public Product { enum ItemRoles { QuantityRole = Product::PriceRole + 1, NameRole }; - Item(interchange_ord_item item) : - product{&item.product}, - quantity{item.quantity}, - name{item.name} {} - Product product; + Item(interchange_ord_item *item) : + quantity{item->quantity}, + name{item->name} + { + init((struct interchange_product *)item); + } unsigned int quantity; QString name; bool operator==(Item const& item) { - return product.sku == item.product.sku; + return sku == item.sku; } }; |