summaryrefslogtreecommitdiff
path: root/member.cxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-08 18:00:44 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-08 18:00:44 +0800
commit97dc735de7a67e6be77c0cad5164267b2c39c4c1 (patch)
tree8aee8f7f8d3c9d6bb0fe20635a652178bc3e4074 /member.cxx
parentc3dce22abc40aa880d8b63ef5e7f1f0f02678e1c (diff)
Interface for setting login next page
Diffstat (limited to 'member.cxx')
-rw-r--r--member.cxx24
1 files changed, 14 insertions, 10 deletions
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,