summaryrefslogtreecommitdiff
path: root/qicclient
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-28 09:32:04 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-28 09:32:04 +0800
commit5d4ca393157362cb9e82022c1f66c61a66ad9077 (patch)
treeb5f1cf586c3e3d9a3fba45631e80fe543139428c /qicclient
parent0d2a18b15d45d612f3b9ba92d7b7af23be7d444f (diff)
Catalog updates from fellow C++ catalog
Diffstat (limited to 'qicclient')
-rw-r--r--qicclient/catalog.hxx14
-rw-r--r--qicclient/client.hxx8
-rw-r--r--qicclient/product.hxx1
3 files changed, 10 insertions, 13 deletions
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 <memory>
#include <QObject>
-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> product);
+ void gotResults(Catalog* catalog);
+ void gotFlyPage(shared_ptr<Product> 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}