From c63914cd24ec7e12c99cae034cf89afa81a9f408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sun, 12 Jul 2020 20:10:21 +0800 Subject: member related functions move to Member class --- CMakeLists.txt | 6 +- client.cxx | 19 ---- libicclient | 2 +- member.cxx | 314 +++++++++++++++++++++++++++++++++++++++++++++++++++ qicclient/client.hxx | 11 -- qicclient/member.hxx | 155 +++++++++++++++++++++++++ qicclient/user.hxx | 147 ------------------------ user.cxx | 235 -------------------------------------- 8 files changed, 473 insertions(+), 416 deletions(-) create mode 100644 member.cxx create mode 100644 qicclient/member.hxx delete mode 100644 qicclient/user.hxx delete mode 100644 user.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index bedb9ba..a0aa505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,11 @@ set(CMAKE_AUTOMOC ON) find_package(Qt5Core) add_library(${PROJECT_NAME} SHARED - ${PROJECT_NAME}/user.hxx + ${PROJECT_NAME}/member.hxx ${PROJECT_NAME}/catalog.hxx ${PROJECT_NAME}/basket.hxx ${PROJECT_NAME}/client.hxx - user.cxx + member.cxx catalog.cxx basket.cxx client.cxx @@ -26,7 +26,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE QICCLIENT) install(TARGETS ${PROJECT_NAME} DESTINATION lib) install(FILES - ${PROJECT_NAME}/user.hxx + ${PROJECT_NAME}/member.hxx ${PROJECT_NAME}/product.hxx ${PROJECT_NAME}/catalog.hxx ${PROJECT_NAME}/basket.hxx diff --git a/client.cxx b/client.cxx index 3b406ad..26d8ad9 100644 --- a/client.cxx +++ b/client.cxx @@ -50,23 +50,4 @@ namespace QICClient { order.setData(c_order); } - void Client::logIn(size_t (*handler)(void*, size_t, size_t, void*), - icclient_member* member, QString const& username, - QString const& password, QString const& successPage, - QString const& nextPage, QString const& failPage) - { - icclient_member_login(handler, member, username.toLatin1().constData(), - password.toLatin1().constData(), - successPage.toLatin1().constData(), - nextPage.toLatin1().constData(), - failPage.toLatin1().constData()); - emit loggedIn(member); - } - - void Client::logOut() - { - icclient_member_logout(); - emit loggedOut(); - } - } diff --git a/libicclient b/libicclient index f2cdda3..3f5ece5 160000 --- a/libicclient +++ b/libicclient @@ -1 +1 @@ -Subproject commit f2cdda353b0da0ec19679ac8753fbe2d17471fd9 +Subproject commit 3f5ece56ba0aa55be5c6a7973866ffda432de1ce diff --git a/member.cxx b/member.cxx new file mode 100644 index 0000000..61bbf0e --- /dev/null +++ b/member.cxx @@ -0,0 +1,314 @@ +#include +#include +#include "qicclient/member.hxx" + +namespace QICClient { + + void Member::logIn(QString const& username, QString const& password, + QString const& successPage, QString const& nextPage, + QString const& failPage, + size_t (*handler)(void*, size_t, size_t, void*)) + { + setData(icclient_member_login(username.toLatin1().constData(), + password.toLatin1().constData(), + successPage.toLatin1().constData(), + nextPage.toLatin1().constData(), + failPage.toLatin1().constData(), + handler)); + } + + void Member::setUserName(QString const& userName) + { + if (m_userName != userName) { + m_userName = userName; + emit userNameChanged(); + } + } + + void Member::setUserNick(QString const& userNick) + { + if (m_userNick != userNick) { + m_userNick = userNick; + emit userNickChanged(); + } + } + + void Member::setPassword(QString const& password) + { + if (m_password != password) { + m_password = password; + emit passwordChanged(); + } + } + + void Member::setExpiration(QString const& expiration) + { + if (m_expiration != expiration) { + m_expiration = expiration; + emit expirationChanged(); + } + } + + void Member::setAcl(QString const& acl) + { + if (m_acl != acl) { + m_acl = acl; + emit aclChanged(); + } + } + + void Member::setModTime(QString const& modTime) + { + if (m_modTime != modTime) { + m_modTime = modTime; + emit modTimeChanged(); + } + } + + void Member::setSNickName(QString const& sNickName) + { + if (m_sNickName != sNickName) { + m_sNickName = sNickName; + emit sNickNameChanged(); + } + } + + void Member::setCompany(QString const& company) + { + if (m_company != company) { + m_company = company; + emit companyChanged(); + } + } + + void Member::setFName(QString const& fName) + { + if (m_fName != fName) { + m_fName = fName; + emit fNameChanged(); + } + } + + void Member::setLName(QString const& lName) + { + if (m_lName != lName) { + m_lName = lName; + emit lNameChanged(); + } + } + + void Member::setAddress1(QString const& address1) + { + if (m_address1 != address1) { + m_address1 = address1; + emit address1Changed(); + } + } + + void Member::setAddress2(QString const& address2) + { + if (m_address2 != address2) { + m_address2 = address2; + emit address2Changed(); + } + } + + void Member::setAddress3(QString const& address3) + { + if (m_address3 != address3) { + m_address3 = address3; + emit address3Changed(); + } + } + + void Member::setCity(QString const& city) + { + if (m_city != city) { + m_city = city; + emit cityChanged(); + } + } + + void Member::setState(QString const& state) + { + if (m_state != state) { + m_state = state; + emit stateChanged(); + } + } + + void Member::setZip(QString const& zip) + { + if (m_zip != zip) { + m_zip = zip; + emit zipChanged(); + } + } + + void Member::setCountry(QString const& country) + { + if (m_country != country) { + m_country = country; + emit countryChanged(); + } + } + + void Member::setPhoneDay(QString const& phoneDay) + { + if (m_phoneDay != phoneDay) { + m_phoneDay = phoneDay; + emit phoneDayChanged(); + } + } + + void Member::setEmail(QString const& email) + { + if (m_email != email) { + m_email = email; + emit emailChanged(); + } + } + + void Member::setData(icclient_member* member) + { + if (member->username && m_userName != member->username) { + m_userName = QString{member->username}; + emit userNameChanged(); + } else if (m_userName != "") { + m_userName = ""; + emit userNameChanged(); + } + if (member->usernick && m_userNick != member->usernick) { + m_userNick = QString{member->usernick}; + emit userNickChanged(); + } else if (m_userNick != "") { + m_userNick = ""; + emit userNickChanged(); + } + if (member->password && m_password != member->password) { + m_password = QString{member->password}; + emit passwordChanged(); + } else if (m_password != "") { + m_password = ""; + emit passwordChanged(); + } + if (member->expiration && m_expiration != member->expiration) { + m_expiration = QString{member->expiration}; + emit expirationChanged(); + } else if (m_expiration != "") { + m_expiration = ""; + emit expirationChanged(); + } + if (member->acl && m_acl != member->acl) { + m_acl = QString{member->acl}; + emit aclChanged(); + } else if (m_acl != "") { + m_acl = ""; + emit aclChanged(); + } + if (member->mod_time && m_modTime != member->mod_time) { + m_modTime = QString{member->mod_time}; + emit modTimeChanged(); + } else if (m_modTime != "") { + m_modTime = ""; + emit modTimeChanged(); + } + if (member->s_nickname && m_sNickName != member->s_nickname) { + m_sNickName = QString{member->s_nickname}; + emit sNickNameChanged(); + } else if (m_sNickName != "") { + m_sNickName = ""; + emit sNickNameChanged(); + } + if (member->company && m_company != member->company) { + m_company = QString{member->company}; + emit companyChanged(); + } else if (m_company != "") { + m_company = ""; + emit companyChanged(); + } + if (member->fname && m_fName != member->fname) { + m_fName = QString{member->fname}; + emit fNameChanged(); + } else if (m_fName != "") { + m_fName = ""; + emit fNameChanged(); + } + if (member->lname && m_lName != member->lname) { + m_lName = QString{member->lname}; + emit lNameChanged(); + } else if (m_lName != "") { + m_lName = ""; + emit lNameChanged(); + } + if (member->address1 && m_address1 != member->address1) { + m_address1 = QString{member->address1}; + emit address1Changed(); + } else if (m_address1 != "") { + m_address1 = ""; + emit address1Changed(); + } + if (member->address2 && m_address2 != member->address2) { + m_address2 = QString{member->address2}; + emit address2Changed(); + } else if (m_address2 != "") { + m_address2 = ""; + emit address2Changed(); + } + if (member->address3 && m_address3 != member->address3) { + m_address3 = QString{member->address3}; + emit address3Changed(); + } else if (m_address3 != "") { + m_address3 = ""; + emit address3Changed(); + } + if (member->city && m_city != member->city) { + m_city = QString{member->city}; + emit cityChanged(); + } else if (m_city != "") { + m_city = ""; + emit cityChanged(); + } + if (member->state && m_state != member->state) { + m_state = QString{member->state}; + emit stateChanged(); + } else if (m_state != "") { + m_state = ""; + emit stateChanged(); + } + if (member->zip && m_zip != member->zip) { + m_zip = QString{member->zip}; + emit zipChanged(); + } else if (m_zip != "") { + m_zip = ""; + emit zipChanged(); + } + if (member->country && m_country != member->country) { + m_country = QString{member->country}; + emit countryChanged(); + } else if (m_country != "") { + m_country = ""; + emit countryChanged(); + } + if (member->phone_day && m_phoneDay != member->phone_day) { + m_phoneDay = QString{member->phone_day}; + emit phoneDayChanged(); + } else if (m_phoneDay != "") { + m_phoneDay = ""; + emit phoneDayChanged(); + } + if (member->email && m_email != member->email) { + m_email = QString{member->email}; + emit emailChanged(); + } else if (m_email != "") { + m_email = ""; + emit emailChanged(); + } + } + + void Member::logOut() + { + icclient_member_logout(m_data); + } + +} diff --git a/qicclient/client.hxx b/qicclient/client.hxx index 26d540d..2f0632d 100644 --- a/qicclient/client.hxx +++ b/qicclient/client.hxx @@ -56,14 +56,6 @@ namespace QICClient { void order(QString const& sku, Catalog const& catalog, Basket& order); - void logIn(size_t (*handler)(void*, size_t, size_t, void*), - icclient_member* member, - QString const& username, - QString const& password, - QString const& successPage = nullptr, - QString const& nextPage = nullptr, - QString const& failPage = nullptr); - public slots: /* void remove(unsigned int const& indices); @@ -83,7 +75,6 @@ namespace QICClient { , QString const& password , QString const& verify); */ - void logOut(); /* void newItem(QString const& description , QString const& comment, @@ -94,8 +85,6 @@ namespace QICClient { signals: void gotResults(Catalog* catalog); void gotFlyPage(shared_ptr product); - void loggedIn(icclient_member* member); - void loggedOut(); }; } diff --git a/qicclient/member.hxx b/qicclient/member.hxx new file mode 100644 index 0000000..d4073c0 --- /dev/null +++ b/qicclient/member.hxx @@ -0,0 +1,155 @@ +#ifndef QICCLIENT_MEMBER_HXX +#define QICCLIENT_MEMBER_HXX + +#include +#include + +struct icclient_member; + +namespace QICClient { + + class Member : public QObject + { + Q_OBJECT + Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged) + Q_PROPERTY(QString userNick READ userNick WRITE setUserNick NOTIFY userNickChanged) + Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) + Q_PROPERTY(QString expiration READ expiration WRITE setExpiration NOTIFY expirationChanged) + Q_PROPERTY(QString acl READ acl WRITE setAcl NOTIFY aclChanged) + Q_PROPERTY(QString modTime READ modTime WRITE setModTime NOTIFY modTimeChanged) + Q_PROPERTY(QString sNickName READ sNickName WRITE setSNickName NOTIFY sNickNameChanged) + Q_PROPERTY(QString company READ company WRITE setCompany NOTIFY companyChanged) + Q_PROPERTY(QString fName READ fName WRITE setFName NOTIFY fNameChanged) + Q_PROPERTY(QString lName READ lName WRITE setLName NOTIFY lNameChanged) + Q_PROPERTY(QString address1 READ address1 WRITE setAddress1 NOTIFY address1Changed) + Q_PROPERTY(QString address2 READ address2 WRITE setAddress2 NOTIFY address2Changed) + Q_PROPERTY(QString address3 READ address3 WRITE setAddress3 NOTIFY address3Changed) + Q_PROPERTY(QString city READ city WRITE setCity NOTIFY cityChanged) + Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) + Q_PROPERTY(QString zip READ zip WRITE setZip NOTIFY zipChanged) + Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged) + Q_PROPERTY(QString phoneDay READ phoneDay WRITE setPhoneDay NOTIFY phoneDayChanged) + Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) + + public: + explicit Member(QObject* parent = nullptr) : + QObject{parent}, + m_userName{""}, + m_userNick{""}, + m_password{""}, + m_expiration{""}, + m_acl{""}, + m_modTime{""}, + m_sNickName{""}, + m_company{""}, + m_fName{""}, + m_lName{""}, + m_address1{""}, + m_address2{""}, + m_address3{""}, + m_city{""}, + m_state{""}, + m_zip{""}, + m_country{""}, + m_phoneDay{""}, + m_email{""}, + m_data{nullptr} + {} + ~Member() {} + + void logIn(QString const& username, QString const& password, + QString const& successPage = nullptr, + QString const& nextPage = nullptr, + QString const& failPage = nullptr, + size_t (*handler)(void*, size_t, size_t, + void*) = nullptr); + void logOut(); + + QString const& userName() const { return m_userName; } + QString const& userNick() const { return m_userNick; } + QString const& password() const { return m_password; } + QString const& expiration() const { return m_expiration; } + QString const& acl() const { return m_acl; } + QString const& modTime() const { return m_modTime; } + QString const& sNickName() const { return m_sNickName; } + QString const& company() const { return m_company; } + QString const& fName() const { return m_fName; } + QString const& lName() const { return m_lName; } + QString const& address1() const { return m_address1; } + QString const& address2() const { return m_address2; } + QString const& address3() const { return m_address3; } + QString const& city() const { return m_city; } + QString const& state() const { return m_state; } + QString const& zip() const { return m_zip; } + QString const& country() const { return m_country; } + QString const& phoneDay() const { return m_phoneDay; } + QString const& email() const { return m_email; } + + void setUserName(QString const& userName); + void setUserNick(QString const& userNick); + void setPassword(QString const& password); + void setExpiration(QString const& expiration); + void setAcl(QString const& acl); + void setModTime(QString const& modTime); + void setSNickName(QString const& sNickName); + void setCompany(QString const& company); + void setFName(QString const& fName); + void setLName(QString const& lName); + void setAddress1(QString const& address1); + void setAddress2(QString const& address2); + void setAddress3(QString const& address3); + void setCity(QString const& city); + void setState(QString const& state); + void setZip(QString const& zip); + void setCountry(QString const& country); + void setPhoneDay(QString const& phoneDay); + void setEmail(QString const& email); + void setData(icclient_member* member); + + signals: + void userNameChanged(); + void userNickChanged(); + void passwordChanged(); + void expirationChanged(); + void aclChanged(); + void modTimeChanged(); + void sNickNameChanged(); + void companyChanged(); + void fNameChanged(); + void lNameChanged(); + void address1Changed(); + void address2Changed(); + void address3Changed(); + void cityChanged(); + void stateChanged(); + void zipChanged(); + void countryChanged(); + void phoneDayChanged(); + void emailChanged(); + + private: + QString m_userName; + QString m_userNick; + QString m_password; + QString m_expiration; + QString m_acl; + QString m_modTime; + QString m_sNickName; + QString m_company; + QString m_fName; + QString m_lName; + QString m_address1; + QString m_address2; + QString m_address3; + QString m_city; + QString m_state; + QString m_zip; + QString m_country; + QString m_phoneDay; + QString m_email; + icclient_member* m_data; + }; + +} + +#endif // QICCLIENT_MEMBER_HXX diff --git a/qicclient/user.hxx b/qicclient/user.hxx deleted file mode 100644 index bb3ca00..0000000 --- a/qicclient/user.hxx +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef QICCLIENT_USER_HXX -#define QICCLIENT_USER_HXX - -#include -#include - -struct icclient_member; - -namespace QICClient { - - class User : public QObject - { - Q_OBJECT - Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged) - Q_PROPERTY(QString userNick READ userNick WRITE setUserNick NOTIFY userNickChanged) - Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) - Q_PROPERTY(QString expiration READ expiration WRITE setExpiration NOTIFY expirationChanged) - Q_PROPERTY(QString acl READ acl WRITE setAcl NOTIFY aclChanged) - Q_PROPERTY(QString modTime READ modTime WRITE setModTime NOTIFY modTimeChanged) - Q_PROPERTY(QString sNickName READ sNickName WRITE setSNickName NOTIFY sNickNameChanged) - Q_PROPERTY(QString company READ company WRITE setCompany NOTIFY companyChanged) - Q_PROPERTY(QString fName READ fName WRITE setFName NOTIFY fNameChanged) - Q_PROPERTY(QString lName READ lName WRITE setLName NOTIFY lNameChanged) - Q_PROPERTY(QString address1 READ address1 WRITE setAddress1 NOTIFY address1Changed) - Q_PROPERTY(QString address2 READ address2 WRITE setAddress2 NOTIFY address2Changed) - Q_PROPERTY(QString address3 READ address3 WRITE setAddress3 NOTIFY address3Changed) - Q_PROPERTY(QString city READ city WRITE setCity NOTIFY cityChanged) - Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) - Q_PROPERTY(QString zip READ zip WRITE setZip NOTIFY zipChanged) - Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged) - Q_PROPERTY(QString phoneDay READ phoneDay WRITE setPhoneDay NOTIFY phoneDayChanged) - Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) - - public: - explicit User(QObject* parent = nullptr) - : QObject{parent} - , m_userName{""} - , m_userNick{""} - , m_password{""} - , m_expiration{""} - , m_acl{""} - , m_modTime{""} - , m_sNickName{""} - , m_company{""} - , m_fName{""} - , m_lName{""} - , m_address1{""} - , m_address2{""} - , m_address3{""} - , m_city{""} - , m_state{""} - , m_zip{""} - , m_country{""} - , m_phoneDay{""} - , m_email{""} - {} - ~User() {} - - QString const& userName() const { return m_userName; } - QString const& userNick() const { return m_userNick; } - QString const& password() const { return m_password; } - QString const& expiration() const { return m_expiration; } - QString const& acl() const { return m_acl; } - QString const& modTime() const { return m_modTime; } - QString const& sNickName() const { return m_sNickName; } - QString const& company() const { return m_company; } - QString const& fName() const { return m_fName; } - QString const& lName() const { return m_lName; } - QString const& address1() const { return m_address1; } - QString const& address2() const { return m_address2; } - QString const& address3() const { return m_address3; } - QString const& city() const { return m_city; } - QString const& state() const { return m_state; } - QString const& zip() const { return m_zip; } - QString const& country() const { return m_country; } - QString const& phoneDay() const { return m_phoneDay; } - QString const& email() const { return m_email; } - - void setUserName(QString const& userName); - void setUserNick(QString const& userNick); - void setPassword(QString const& password); - void setExpiration(QString const& expiration); - void setAcl(QString const& acl); - void setModTime(QString const& modTime); - void setSNickName(QString const& sNickName); - void setCompany(QString const& company); - void setFName(QString const& fName); - void setLName(QString const& lName); - void setAddress1(QString const& address1); - void setAddress2(QString const& address2); - void setAddress3(QString const& address3); - void setCity(QString const& city); - void setState(QString const& state); - void setZip(QString const& zip); - void setCountry(QString const& country); - void setPhoneDay(QString const& phoneDay); - void setEmail(QString const& email); - - public slots: - void update(icclient_member* member); - - signals: - void userNameChanged(); - void userNickChanged(); - void passwordChanged(); - void expirationChanged(); - void aclChanged(); - void modTimeChanged(); - void sNickNameChanged(); - void companyChanged(); - void fNameChanged(); - void lNameChanged(); - void address1Changed(); - void address2Changed(); - void address3Changed(); - void cityChanged(); - void stateChanged(); - void zipChanged(); - void countryChanged(); - void phoneDayChanged(); - void emailChanged(); - - private: - QString m_userName; - QString m_userNick; - QString m_password; - QString m_expiration; - QString m_acl; - QString m_modTime; - QString m_sNickName; - QString m_company; - QString m_fName; - QString m_lName; - QString m_address1; - QString m_address2; - QString m_address3; - QString m_city; - QString m_state; - QString m_zip; - QString m_country; - QString m_phoneDay; - QString m_email; - }; - -} - -#endif // QICCLIENT_USER_HXX diff --git a/user.cxx b/user.cxx deleted file mode 100644 index eb7b7dd..0000000 --- a/user.cxx +++ /dev/null @@ -1,235 +0,0 @@ -#include -#include -#include "qicclient/user.hxx" - -namespace QICClient { - - void User::setUserName(QString const& UserName) - { - if (m_userName != UserName) { - m_userName = UserName; - emit userNameChanged(); - } - } - - void User::setUserNick(QString const& UserNick) - { - if (m_userNick != UserNick) { - m_userNick = UserNick; - emit userNickChanged(); - } - } - - void User::setPassword(QString const& password) - { - if (m_password != password) { - m_password = password; - emit passwordChanged(); - } - } - - void User::setExpiration(QString const& expiration) - { - if (m_expiration != expiration) { - m_expiration = expiration; - emit expirationChanged(); - } - } - - void User::setAcl(QString const& acl) - { - if (m_acl != acl) { - m_acl = acl; - emit aclChanged(); - } - } - - void User::setModTime(QString const& modTime) - { - if (m_modTime != modTime) { - m_modTime = modTime; - emit modTimeChanged(); - } - } - - void User::setSNickName(QString const& sNickName) - { - if (m_sNickName != sNickName) { - m_sNickName = sNickName; - emit sNickNameChanged(); - } - } - - void User::setCompany(QString const& company) - { - if (m_company != company) { - m_company = company; - emit companyChanged(); - } - } - - void User::setFName(QString const& fName) - { - if (m_fName != fName) { - m_fName = fName; - emit fNameChanged(); - } - } - - void User::setLName(QString const& lName) - { - if (m_lName != lName) { - m_lName = lName; - emit lNameChanged(); - } - } - - void User::setAddress1(QString const& address1) - { - if (m_address1 != address1) { - m_address1 = address1; - emit address1Changed(); - } - } - - void User::setAddress2(QString const& address2) - { - if (m_address2 != address2) { - m_address2 = address2; - emit address2Changed(); - } - } - - void User::setAddress3(QString const& address3) - { - if (m_address3 != address3) { - m_address3 = address3; - emit address3Changed(); - } - } - - void User::setCity(QString const& city) - { - if (m_city != city) { - m_city = city; - emit cityChanged(); - } - } - - void User::setState(QString const& state) - { - if (m_state != state) { - m_state = state; - emit stateChanged(); - } - } - - void User::setZip(QString const& zip) - { - if (m_zip != zip) { - m_zip = zip; - emit zipChanged(); - } - } - - void User::setCountry(QString const& country) - { - if (m_country != country) { - m_country = country; - emit countryChanged(); - } - } - - void User::setPhoneDay(QString const& phoneDay) - { - if (m_phoneDay != phoneDay) { - m_phoneDay = phoneDay; - emit phoneDayChanged(); - } - } - - void User::setEmail(QString const& email) - { - if (m_email != email) { - m_email = email; - emit emailChanged(); - } - } - - void User::update(icclient_member* member) - { - if (member->username) - m_userName = QString{member->username}; - else - m_userName = ""; - if (member->usernick) - m_userNick = QString{member->usernick}; - else - m_userNick = ""; - if (member->fname) - m_fName = QString{member->fname}; - else - m_fName = ""; - if (member->lname) - m_lName = QString{member->lname}; - else - m_lName = ""; - if (member->address1) - m_address1 = QString{member->address1}; - else - m_address1 = ""; - if (member->address2) - m_address2 = QString{member->address2}; - else - m_address2 = ""; - if (member->address3) - m_address3 = QString{member->address3}; - else - m_address3 = ""; - if (member->city) - m_city = QString{member->city}; - else - m_city = ""; - if (member->state) - m_state = QString{member->state}; - else - m_state = ""; - if (member->zip) - m_zip = QString{member->zip}; - else - m_zip = ""; - if (member->country) - m_country = QString{member->country}; - else - m_country = ""; - if (member->phone_day) - m_phoneDay = QString{member->phone_day}; - else - m_phoneDay = ""; - if (member->email) - m_email = QString{member->email}; - else - m_email = ""; - - emit userNameChanged(); - emit userNickChanged(); - emit passwordChanged(); - emit expirationChanged(); - emit aclChanged(); - emit modTimeChanged(); - emit sNickNameChanged(); - emit companyChanged(); - emit fNameChanged(); - emit lNameChanged(); - emit address1Changed(); - emit address2Changed(); - emit address3Changed(); - emit cityChanged(); - emit stateChanged(); - emit zipChanged(); - emit countryChanged(); - emit phoneDayChanged(); - emit emailChanged(); - } - -} -- cgit v1.2.3