From eaee50219505ff98d8758c0ef3d3c26b4593728b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 14 Mar 2023 10:00:03 +0800 Subject: Flypage is the right term all this time --- interchange.cxx | 27 ++++++++++++++------------- interchange.hxx | 15 ++++++++------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/interchange.cxx b/interchange.cxx index 2daba1e..c9faf1f 100644 --- a/interchange.cxx +++ b/interchange.cxx @@ -21,6 +21,15 @@ namespace QInterchange { interchange_cleanup(); } + void Interchange::flypage(QString const& path) + { + interchange_flypage(path.toLatin1().constData(), + [](interchange_response* response) { + interchange->emitFlypage(QString{response->data}); + interchange_free_response(response); + }); + } + void Interchange::catalog(QString const& prodGroup) { interchange_catalog(prodGroup.toLatin1().constData(), [](interchange_response* response) { @@ -42,14 +51,6 @@ namespace QInterchange { }, nullptr); } - void Interchange::page(QString const& path) - { - interchange_page(path.toLatin1().constData(), [](interchange_response* response) { - interchange->emitPage(QString{response->data}); - interchange_free_response(response); - }); - } - void Interchange::defaultCatalog(QString const& prodGroup) { interchange_catalog(prodGroup.toLatin1().constData(), nullptr, [](struct interchange_catalog* catalog) { @@ -62,6 +63,11 @@ namespace QInterchange { defaultCatalog("All-Products"); } + void Interchange::emitFlypage(QString const& response) + { + emit gotFlypage(response); + } + void Interchange::emitCatalog(QString const& response) { emit gotCatalog(response); @@ -72,11 +78,6 @@ namespace QInterchange { emit gotProduct(response); } - void Interchange::emitPage(QString const& response) - { - emit gotPage(response); - } - void Interchange::emitOrder(QString const& response) { emit gotOrder(response); diff --git a/interchange.hxx b/interchange.hxx index b8b36d5..ae5d5e8 100644 --- a/interchange.hxx +++ b/interchange.hxx @@ -30,6 +30,12 @@ namespace QInterchange { ~Interchange(); public slots: + /*! + * \brief Generic function for fetching data using + * a relative path. + * \param path The path. + */ + void flypage(QString const& path); /*! * \brief For fetching products that belong a specific group. * \param prodGroup The name of the product group. @@ -44,11 +50,6 @@ namespace QInterchange { * \param sku The SKU of the item to order. */ void product(QString const& sku); - /*! - * \brief For fetching data from a specific path. - * \param path The path. - */ - void page(QString const& path); /*! * \brief For fetching products that belong a specific group. * \param prodGroup The name of the product group. @@ -65,15 +66,15 @@ namespace QInterchange { void order(QString const& sku); signals: + void gotFlypage(QString const& response); void gotCatalog(QString const& response); void gotProduct(QString const& response); - void gotPage(QString const& response); void gotOrder(QString const& response); protected: + void emitFlypage(QString const& response); void emitCatalog(QString const& response); void emitProduct(QString const& response); - void emitPage(QString const& response); void emitOrder(QString const& response); }; -- cgit v1.2.3