diff options
-rw-r--r-- | catalog.cxx | 4 | ||||
-rw-r--r-- | client.cxx | 2 | ||||
-rw-r--r-- | qicclient/catalog.hxx | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/catalog.cxx b/catalog.cxx index 61fd0fd..6415de7 100644 --- a/catalog.cxx +++ b/catalog.cxx @@ -6,7 +6,7 @@ namespace ICClient { Catalog::Catalog(icclient_catalog* catalog, QObject* parent) : - catalog{catalog}, + m_data{catalog}, QAbstractListModel{parent} { for (size_t i = 0; i < catalog->length; i++) @@ -92,7 +92,7 @@ namespace ICClient { product.crossSell = catalog->data(index, Product::CrossSellRole).toStringList(); addProduct(product); } - this->catalog = const_cast<icclient_catalog*>(catalog->c_catalog()); + this->m_data = const_cast<icclient_catalog*>(catalog->constData()); emit updated(); } @@ -45,7 +45,7 @@ namespace ICClient { void Client::order(QString const& sku, Catalog const& catalog, Basket& order) { auto c_order = order.data(); - icclient_order(sku.toLatin1().constData(), catalog.c_catalog(), &c_order); + icclient_order(sku.toLatin1().constData(), catalog.constData(), &c_order); order.setData(c_order); } diff --git a/qicclient/catalog.hxx b/qicclient/catalog.hxx index 7f1dcfd..d643d2e 100644 --- a/qicclient/catalog.hxx +++ b/qicclient/catalog.hxx @@ -17,7 +17,7 @@ namespace ICClient { 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; - icclient_catalog const* c_catalog() const { return catalog; } + icclient_catalog const* constData() const { return m_data; } public slots: void update(Catalog* catalog); @@ -31,7 +31,7 @@ namespace ICClient { private: void addProduct(Product const& product); QList<Product> products; - icclient_catalog* catalog; + icclient_catalog* m_data; }; } |