From c7437e1a93fc9ee7ab466aafe393daf967f3771c 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:36:56 +0800 Subject: Requested path on flypage signal as flypage is generic, so the caller will need to know the context. --- interchange.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'interchange.cxx') diff --git a/interchange.cxx b/interchange.cxx index c9faf1f..ead53ce 100644 --- a/interchange.cxx +++ b/interchange.cxx @@ -4,6 +4,7 @@ namespace QInterchange { static Interchange* interchange; + static const QString* currentPath; Interchange::Interchange(const char* sampleURL, const char* image_Dir, const QString& cookie, const QString& certificate) @@ -23,9 +24,11 @@ namespace QInterchange { void Interchange::flypage(QString const& path) { + currentPath = &path; interchange_flypage(path.toLatin1().constData(), [](interchange_response* response) { - interchange->emitFlypage(QString{response->data}); + interchange->emitFlypage(*currentPath, + QString{response->data}); interchange_free_response(response); }); } @@ -63,9 +66,10 @@ namespace QInterchange { defaultCatalog("All-Products"); } - void Interchange::emitFlypage(QString const& response) + void Interchange::emitFlypage(QString const& path, + QString const& response) { - emit gotFlypage(response); + emit gotFlypage(path, response); } void Interchange::emitCatalog(QString const& response) -- cgit v1.2.3