diff options
Diffstat (limited to 'controller.cxx')
-rw-r--r-- | controller.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/controller.cxx b/controller.cxx index 5bf63e3..877c163 100644 --- a/controller.cxx +++ b/controller.cxx @@ -1,18 +1,18 @@ #include <QtQml> -#include <icclient.h> -#include <qicclient.hxx> +#include <interchange.h> +#include <interchange.hxx> #include "controller.hxx" static QQmlApplicationEngine* engine; static QString* certFile = nullptr; static Controller* controller; -using namespace QICClient; -static Client* shop = nullptr; +using namespace QInterchange; +static Interchange* shop = nullptr; static Catalog* allProducts = nullptr; extern "C" { - void sign_up(char const*, char const*, void (*)(icclient_response*)); - struct icclient_catalog* catalog(char const*, char const*); + void sign_up(char const*, char const*, void (*)(interchange_response*)); + struct interchange_catalog* catalog(char const*, char const*); } Controller::Controller(QObject* parent) : QObject{parent} @@ -38,11 +38,11 @@ void Controller::signUp(QString const& brand) #endif controller = this; sign_up(brand.toLatin1().constData(), certFile ? certFile->toLatin1().constData() : nullptr, - [](icclient_response* response) { + [](interchange_response* response) { const_cast<char*>(response->data)[response->numBytes] = '\0'; QString brand{response->data}; - icclient_free_response(response); - shop = new Client{QString{QString{SECURE_SERVER} % "/" % brand}.toLatin1().constData(), + interchange_free_response(response); + shop = new Interchange{QString{QString{SECURE_SERVER} % "/" % brand}.toLatin1().constData(), QString{"/" % brand % "/images"}.toLatin1().constData(), certFile ? certFile->toLatin1().constData() : nullptr}; if (certFile) delete certFile; @@ -63,7 +63,7 @@ void Controller::link(QString const& brand) void Controller::allProducts(QString const& brand) { - connect(shop, &Client::gotCatalog, [brand](QString const& response) { + connect(shop, &Interchange::gotCatalog, [brand](QString const& response) { ::allProducts = new Catalog{catalog(response.toLatin1().constData(), QString{"/" % brand % "/images"}.toLatin1().constData())}; engine->rootContext()->setContextProperty("catalog", ::allProducts); |