summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.cxx4
-rw-r--r--qicclient/client.hxx6
2 files changed, 7 insertions, 3 deletions
diff --git a/client.cxx b/client.cxx
index c7950a8..f5c2734 100644
--- a/client.cxx
+++ b/client.cxx
@@ -1,6 +1,8 @@
#include <cstddef>
+#include <QObject>
#include <icclient/client.h>
#include <icclient/member.h>
+#include "qicclient/product.hxx"
#include "qicclient/client.hxx"
namespace ICClient {
@@ -37,7 +39,7 @@ namespace ICClient {
{
icclient_product* product = nullptr;
icclient_flypage(handler, &product, sku.toLatin1().constData());
- emit gotFlyPage(product);
+ if (product) emit gotFlyPage(std::shared_ptr<Product>{new ICClient::Product{product}});
}
void Client::order(icclient_ord_order** orderPtr, QString const& sku
diff --git a/qicclient/client.hxx b/qicclient/client.hxx
index 0ab7a3d..b73c6a2 100644
--- a/qicclient/client.hxx
+++ b/qicclient/client.hxx
@@ -1,15 +1,17 @@
#ifndef QICCLIENT_CLIENT_HXX
#define QICCLIENT_CLIENT_HXX
+#include <memory>
#include <QObject>
struct icclient_catalog;
-struct icclient_product;
struct icclient_ord_order;
struct icclient_user;
namespace ICClient {
+ class Product;
+
class Client : public QObject
{
Q_OBJECT
@@ -69,7 +71,7 @@ namespace ICClient {
signals:
void gotResults(icclient_catalog* catalog);
- void gotFlyPage(icclient_product* product);
+ void gotFlyPage(std::shared_ptr<Product> product);
void ordered(icclient_ord_order* order);
void loggedIn(icclient_user* user);
void loggedOut();