From 76e22f15b9f7eb9227d6ba32198ea1f5464664e5 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: Mon, 13 Mar 2023 13:17:33 +0800 Subject: Member data init from C struct is at constructor with a copy, and the need to keep a pointer to the C struct is no more. --- interchange/member.hxx | 6 ++---- interchange/ord.hxx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'interchange') diff --git a/interchange/member.hxx b/interchange/member.hxx index 897b086..3f00dba 100644 --- a/interchange/member.hxx +++ b/interchange/member.hxx @@ -33,6 +33,8 @@ namespace QInterchange { public: explicit Member(QObject* parent = nullptr); + explicit Member(struct interchange_member member, + QObject* parent = nullptr); ~Member() {} QString const& userName() const { return m_userName; } @@ -54,7 +56,6 @@ namespace QInterchange { QString const& country() const { return m_country; } QString const& phoneDay() const { return m_phoneDay; } QString const& email() const { return m_email; } - interchange_member* data() { return m_data; } void setUserName(QString const& userName); void setUserNick(QString const& userNick); @@ -75,7 +76,6 @@ namespace QInterchange { void setCountry(QString const& country); void setPhoneDay(QString const& phoneDay); void setEmail(QString const& email); - void setData(interchange_member* data); public slots: void newAccount(QString const& username, @@ -151,9 +151,7 @@ namespace QInterchange { QString m_country; QString m_phoneDay; QString m_email; - interchange_member* m_data; }; - } #endif diff --git a/interchange/ord.hxx b/interchange/ord.hxx index 4ec06b4..985f923 100644 --- a/interchange/ord.hxx +++ b/interchange/ord.hxx @@ -45,7 +45,7 @@ namespace QInterchange { void setProfile(QString const& profile); public slots: // void remove(unsigned int const& indices); - void checkout(Member& member); + void checkout(const Member& member); signals: void rowCountChanged(); void subtotalChanged(); -- cgit v1.2.3