summaryrefslogtreecommitdiff
path: root/qicclient/product.hxx
blob: 4fe67ac05efbc5b6218f34e506225b3940d53bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef QICCLIENT_PRODUCT_HXX
#define QICCLIENT_PRODUCT_HXX

#include <icclient/product.h>

namespace ICClient {

	struct Product
	{
		enum ProductRoles {
			SkuRole = Qt::UserRole + 1,
			DescriptionRole,
			CommentRole,
			ImageRole,
			PriceRole,
			AuthorRole
		};

		Product(icclient_product* product) : sku{product->sku}
		{
			if (product->description)
				description = QString{product->description};
			if (product->comment)
				comment = QString{product->comment};
			if (product->image)
				image = QString{product->image};
			if (product->price)
				price = product->price;
			if (product->author)
				author = QString{product->author};
		}

		QString sku;
		QString description;
		QString comment;
		QString image;
		double price;
		QString author;
	};

}

#endif // QICCLIENT_PRODUCT_HXX