diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-12 17:08:09 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-12 17:08:09 +0800 |
commit | 628fbf1304bff4de9be752d2f4be77d58a5ab689 (patch) | |
tree | 1147c70e6a14d6974deac5080ed128c89017e136 | |
parent | 6ea1859f82fdde343be5d7d649d40e43223395e3 (diff) |
Product is constructed using C struct copy
-rw-r--r-- | interchange/product.hxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/interchange/product.hxx b/interchange/product.hxx index eda700a..b8e6714 100644 --- a/interchange/product.hxx +++ b/interchange/product.hxx @@ -23,30 +23,30 @@ namespace QInterchange { }; Product() {} - Product(struct interchange_product* product) : - price{product->price}, - weight{product->weight} + Product(struct interchange_product product) : + price{product.price}, + weight{product.weight} { - if (product->sku) - sku = QString{product->sku}; - if (product->description) - description = QString{product->description}; - if (product->title) - title = QString{product->title}; - if (product->comment) - comment = QString{product->comment}; - if (product->thumb) - thumb = QString{product->thumb}; - if (product->image) - image = QString{product->image}; - if (product->prod_group) - prodGroup = QString{product->prod_group}; - if (product->category) - category = QString{product->category}; - if (product->author) - author = QString{product->author}; - if (product->crosssell) { - auto crosssell = product->crosssell; + if (product.sku) + sku = QString{product.sku}; + if (product.description) + description = QString{product.description}; + if (product.title) + title = QString{product.title}; + if (product.comment) + comment = QString{product.comment}; + if (product.thumb) + thumb = QString{product.thumb}; + if (product.image) + image = QString{product.image}; + if (product.prod_group) + prodGroup = QString{product.prod_group}; + if (product.category) + category = QString{product.category}; + if (product.author) + author = QString{product.author}; + if (product.crosssell) { + auto crosssell = product.crosssell; for (size_t i = 0; i < crosssell->length; i++) crossSell << QString{crosssell->skus[i]}; } |