From 97dc735de7a67e6be77c0cad5164267b2c39c4c1 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: Wed, 8 Mar 2023 18:00:44 +0800 Subject: Interface for setting login next page --- member.cxx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'member.cxx') diff --git a/member.cxx b/member.cxx index ecef5f9..fb4396a 100644 --- a/member.cxx +++ b/member.cxx @@ -5,7 +5,7 @@ namespace QInterchange { static Member* member; - static char *unCopy, *pwCopy, *vCopy, *fpCopy; + static char *unCopy, *pwCopy, *vCopy, *npCopy, *fpCopy; static interchange_member* mPtr; Member::Member(QObject* parent) : @@ -62,7 +62,7 @@ namespace QInterchange { } void Member::logIn(QString const& username, QString const& password, - QString const& failPage) + QString const& nextPage, QString const& failPage) { auto unData = username.toLatin1().constData(); unCopy = (char*)malloc(strlen(unData) + 1); @@ -70,17 +70,21 @@ namespace QInterchange { auto pwData = password.toLatin1().constData(); pwCopy = (char*)malloc(strlen(pwData) + 1); strcpy(pwCopy, pwData); + auto npData = nextPage.toLatin1().constData(); + npCopy = (char*)malloc(strlen(npData) + 1); + strcpy(npCopy, npData); auto fpData = failPage.toLatin1().constData(); fpCopy = (char*)malloc(strlen(fpData) + 1); strcpy(fpCopy, fpData); - interchange_member_login(unCopy, pwCopy, fpCopy, - [](interchange_response* response) { - free(unCopy); - free(pwCopy); - free(fpCopy); - member->emitLogin(QString{response->data}); - interchange_free_response(response); - }, nullptr); + interchange_member_login(unCopy, pwCopy, npCopy, fpCopy, + [](interchange_response* response) { + free(unCopy); + free(pwCopy); + free(npCopy); + free(fpCopy); + member->emitLogin(QString{response->data}); + interchange_free_response(response); + }, nullptr); } void Member::setAccount(QString const& firstName, -- cgit v1.2.3