From 5d4ca393157362cb9e82022c1f66c61a66ad9077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sun, 28 Jun 2020 09:32:04 +0800 Subject: Catalog updates from fellow C++ catalog --- qicclient/catalog.hxx | 14 +++++--------- qicclient/client.hxx | 8 ++++---- qicclient/product.hxx | 1 + 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'qicclient') diff --git a/qicclient/catalog.hxx b/qicclient/catalog.hxx index 317ea91..dfa7a7c 100644 --- a/qicclient/catalog.hxx +++ b/qicclient/catalog.hxx @@ -13,17 +13,13 @@ namespace ICClient { Q_OBJECT public: - explicit Catalog(QObject* parent = nullptr) : - QAbstractListModel{parent} {} - - int rowCount(QModelIndex const& parent - = QModelIndex()) const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex& index, - int role = Qt::DisplayRole - ) const Q_DECL_OVERRIDE; + Catalog(icclient_catalog* catalog, QObject* parent = nullptr); + Catalog(QObject* parent = nullptr) : QAbstractListModel{parent} {} + int rowCount(QModelIndex const& parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; public slots: - void update(icclient_catalog* catalog); + void update(Catalog* catalog); signals: void updated(); diff --git a/qicclient/client.hxx b/qicclient/client.hxx index b73c6a2..a87f83f 100644 --- a/qicclient/client.hxx +++ b/qicclient/client.hxx @@ -1,15 +1,15 @@ #ifndef QICCLIENT_CLIENT_HXX #define QICCLIENT_CLIENT_HXX -#include #include -struct icclient_catalog; struct icclient_ord_order; struct icclient_user; namespace ICClient { + using std::shared_ptr; + class Catalog; class Product; class Client : public QObject @@ -70,8 +70,8 @@ namespace ICClient { */ signals: - void gotResults(icclient_catalog* catalog); - void gotFlyPage(std::shared_ptr product); + void gotResults(Catalog* catalog); + void gotFlyPage(shared_ptr product); void ordered(icclient_ord_order* order); void loggedIn(icclient_user* user); void loggedOut(); diff --git a/qicclient/product.hxx b/qicclient/product.hxx index 79584c7..ae23459 100644 --- a/qicclient/product.hxx +++ b/qicclient/product.hxx @@ -20,6 +20,7 @@ namespace ICClient { CrossSellRole }; + Product() {} Product(icclient_product* product) : price{product->price}, weight{product->weight} -- cgit v1.2.3