diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-01 06:49:48 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-01 06:49:48 +0800 |
commit | 117a8cf40b39d36fe2d5794c20fb6600e92f52e9 (patch) | |
tree | 9d46a4268c74ff1bfe1489064b2744348c98fba1 | |
parent | 8182f9b0bdf1c8ec53d6b0630bfd3be69d33cfba (diff) | |
parent | bd0e74d11e666126c97c34c5b508dbe811b128c3 (diff) |
Merge branch 'master' into cmake
-rw-r--r-- | client.cxx | 35 | ||||
m--------- | librtclient | 0 | ||||
-rw-r--r-- | qrtclient/client.hxx | 22 | ||||
-rw-r--r-- | qrtclient/ticket.hxx | 5 | ||||
-rw-r--r-- | qrtclient/user.hxx | 22 | ||||
-rw-r--r-- | ticket.cxx | 4 | ||||
-rw-r--r-- | user.cxx | 46 |
7 files changed, 71 insertions, 63 deletions
@@ -1,6 +1,7 @@ #include <QStringBuilder> #include <rtclient/client.h> #include <rtclient/ticket.h> +#include <rtclient/search.h> #include "qrtclient/client.hxx" namespace RTClient { @@ -36,8 +37,8 @@ namespace RTClient { , QString const& comments , QString const& signature , QString const& gecos - , rtclient_lang lang - , rtclient_timezone timeZone + , rtclient_user_lang lang + , rtclient_user_timezone timezone , bool disabled , bool privileged) { @@ -62,7 +63,7 @@ namespace RTClient { , signature.toLatin1().constData() , gecos.toLatin1().constData() , lang - , timeZone + , timezone , disabled , privileged); } @@ -85,13 +86,13 @@ namespace RTClient { , QString const& requestor , QString const& subject , QString const& cc - , QString const& admincc + , QString const& adminCc , QString const& owner , QString const& status , QString const& priority - , QString const& initialpriority - , QString const& finalpriority - , QString const& timeestimated + , QString const& initialPriority + , QString const& finalPriority + , QString const& timeEstimated , QString const& starts , QString const& due , QString const& text) @@ -100,29 +101,31 @@ namespace RTClient { , requestor.toLatin1().constData() , subject.toLatin1().constData() , cc.toLatin1().constData() - , admincc.toLatin1().constData() + , adminCc.toLatin1().constData() , owner.toLatin1().constData() , status.toLatin1().constData() , priority.toLatin1().constData() - , initialpriority.toLatin1().constData() - , finalpriority.toLatin1().constData() - , timeestimated.toLatin1().constData() + , initialPriority.toLatin1().constData() + , finalPriority.toLatin1().constData() + , timeEstimated.toLatin1().constData() , starts.toLatin1().constData() , due.toLatin1().constData() , text.toLatin1().constData()); } - void Client::ticketSearch(QString const& owner) + void Client::searchTicket(QString const& owner) { QString query{"Owner='" % owner % "'"}; - rtclient_ticketlist* ticketList = nullptr; - rtclient_ticket_search(&ticketList, query.toLatin1().constData()); - emit ticketSearched(ticketList); + rtclient_search_ticket_list* ticketList = nullptr; + rtclient_search_ticket(&ticketList, query.toLatin1().constData()); + emit searchedTicket(ticketList); } void Client::ticketHistory(int id) { - rtclient_ticket_history(id); + rtclient_ticket_history_list* historyList = nullptr; + rtclient_ticket_history(&historyList, id); + emit gotTicketHistory(historyList); } Client::~Client() diff --git a/librtclient b/librtclient -Subproject 0aff874caec82d8188057d9566e1292678d7a78 +Subproject 494a46196ade016b606716b36045f6b08a3234b diff --git a/qrtclient/client.hxx b/qrtclient/client.hxx index cf7cba9..b672620 100644 --- a/qrtclient/client.hxx +++ b/qrtclient/client.hxx @@ -5,7 +5,8 @@ #include <rtclient/user.h> struct rtclient_user; -struct rtclient_ticketlist; +struct rtclient_search_ticket_list; +struct rtclient_ticket_history_list; namespace RTClient { @@ -39,8 +40,10 @@ namespace RTClient { , QString const& comments = nullptr , QString const& signature = nullptr , QString const& gecos = nullptr - , rtclient_lang lang = RTCLIENT_LANG_NONE - , rtclient_timezone timeZone = RTCLIENT_TIMEZONE_NONE + , rtclient_user_lang lang + = RTCLIENT_USER_LANG_NONE + , rtclient_user_timezone timezone + = RTCLIENT_USER_TIMEZONE_NONE , bool disabled = false , bool privileged = false); void userShow(unsigned int id); @@ -49,23 +52,24 @@ namespace RTClient { , QString const& requestor = nullptr , QString const& subject = nullptr , QString const& cc = nullptr - , QString const& admincc = nullptr + , QString const& adminCc = nullptr , QString const& owner = nullptr , QString const& status = nullptr , QString const& priority = nullptr - , QString const& initialpriority = nullptr - , QString const& finalpriority = nullptr - , QString const& timeestimated = nullptr + , QString const& initialPriority = nullptr + , QString const& finalPriority = nullptr + , QString const& timeEstimated = nullptr , QString const& starts = nullptr , QString const& due = nullptr , QString const& text = nullptr); - void ticketSearch(QString const& owner); + void searchTicket(QString const& owner); void ticketHistory(int id); signals: void loggedIn(QString const& name); void userShown(rtclient_user* user); - void ticketSearched(rtclient_ticketlist* list); + void searchedTicket(rtclient_search_ticket_list* list); + void gotTicketHistory(rtclient_ticket_history_list* list); }; } diff --git a/qrtclient/ticket.hxx b/qrtclient/ticket.hxx index 25c067f..d02954b 100644 --- a/qrtclient/ticket.hxx +++ b/qrtclient/ticket.hxx @@ -3,8 +3,9 @@ #include <QAbstractListModel> #include <rtclient/ticket.h> +#include <rtclient/search.h> -struct rtclient_ticketlist; +struct rtclient_search_ticket_list; namespace RTClient { @@ -44,7 +45,7 @@ namespace RTClient { ) const Q_DECL_OVERRIDE; public slots: - void update(rtclient_ticketlist* ticketList); + void update(rtclient_search_ticket_list* ticketList); protected: QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; diff --git a/qrtclient/user.hxx b/qrtclient/user.hxx index 5b692a6..e4a1c45 100644 --- a/qrtclient/user.hxx +++ b/qrtclient/user.hxx @@ -32,8 +32,8 @@ namespace RTClient { Q_PROPERTY(QString comments READ comments WRITE setComments NOTIFY commentsChanged) Q_PROPERTY(QString signature READ signature WRITE setSignature NOTIFY signatureChanged) Q_PROPERTY(QString gecos READ gecos WRITE setGecos NOTIFY gecosChanged) - Q_PROPERTY(rtclient_lang lang READ lang WRITE setLang NOTIFY langChanged) - Q_PROPERTY(rtclient_timezone timeZone READ timeZone WRITE setTimeZone NOTIFY timeZoneChanged) + Q_PROPERTY(rtclient_user_lang lang READ lang WRITE setLang NOTIFY langChanged) + Q_PROPERTY(rtclient_user_timezone timezone READ timezone WRITE setTimeZone NOTIFY timezoneChanged) Q_PROPERTY(bool privileged READ privileged WRITE setPrivileged NOTIFY privilegedChanged) Q_PROPERTY(bool disabled READ disabled WRITE setDisabled NOTIFY disabledChanged) @@ -61,8 +61,8 @@ namespace RTClient { , m_comments{""} , m_signature{""} , m_gecos{""} - , m_lang{RTCLIENT_LANG_NONE} - , m_timeZone{RTCLIENT_TIMEZONE_NONE} + , m_lang{RTCLIENT_USER_LANG_NONE} + , m_timezone{RTCLIENT_USER_TIMEZONE_NONE} , m_privileged{false} , m_disabled{true} {} @@ -89,8 +89,8 @@ namespace RTClient { QString const& comments() const { return m_comments; } QString const& signature() const { return m_signature; } QString const& gecos() const { return m_gecos; } - rtclient_lang lang() const { return m_lang; } - rtclient_timezone timeZone() const { return m_timeZone; } + rtclient_user_lang lang() const { return m_lang; } + rtclient_user_timezone timezone() const { return m_timezone; } bool privileged() const { return m_privileged; } bool disabled() const { return m_disabled; } @@ -115,8 +115,8 @@ namespace RTClient { void setComments(QString const& comments); void setSignature(QString const& signature); void setGecos(QString const& gecos); - void setLang(rtclient_lang lang); - void setTimeZone(rtclient_timezone timeZone); + void setLang(rtclient_user_lang lang); + void setTimeZone(rtclient_user_timezone timezone); void setPrivileged(bool privileged); void setDisabled(bool disabled); @@ -146,7 +146,7 @@ namespace RTClient { void signatureChanged(); void gecosChanged(); void langChanged(); - void timeZoneChanged(); + void timezoneChanged(); void privilegedChanged(); void disabledChanged(); @@ -172,8 +172,8 @@ namespace RTClient { QString m_comments; QString m_signature; QString m_gecos; - rtclient_lang m_lang; - rtclient_timezone m_timeZone; + rtclient_user_lang m_lang; + rtclient_user_timezone m_timezone; bool m_privileged; bool m_disabled; }; @@ -42,12 +42,12 @@ namespace RTClient { emit rowCountChanged(); } - void TicketList::update(rtclient_ticketlist* ticketList) + void TicketList::update(rtclient_search_ticket_list* ticketList) { if (ticketList) { for (size_t i = 0; i < ticketList->length; i++) addTicket(Ticket{ticketList->tickets[i]}); - rtclient_ticket_freelist(ticketList); + rtclient_search_ticket_free(ticketList); } emit updated(); } @@ -172,7 +172,7 @@ namespace RTClient { } } - void User::setLang(rtclient_lang lang) + void User::setLang(rtclient_user_lang lang) { if (m_lang != lang) { m_lang = lang; @@ -180,11 +180,11 @@ namespace RTClient { } } - void User::setTimeZone(rtclient_timezone timeZone) + void User::setTimeZone(rtclient_user_timezone timezone) { - if (m_timeZone != timeZone) { - m_timeZone = timeZone; - emit timeZoneChanged(); + if (m_timezone != timezone) { + m_timezone = timezone; + emit timezoneChanged(); } } @@ -211,16 +211,16 @@ namespace RTClient { m_id = user->id; emit idChanged(); } - if (user->emailaddress) { - m_emailAddress = user->emailaddress; + if (user->email_address) { + m_emailAddress = user->email_address; emit emailAddressChanged(); } - if (user->realname) { - m_realName = user->realname; + if (user->real_name) { + m_realName = user->real_name; emit realNameChanged(); } - if (user->nickname) { - m_nickName = user->nickname; + if (user->nick_name) { + m_nickName = user->nick_name; emit nickNameChanged(); } if (user->organization) { @@ -251,20 +251,20 @@ namespace RTClient { m_country = user->country; emit countryChanged(); } - if (user->homephone) { - m_homePhone = user->homephone; + if (user->home_phone) { + m_homePhone = user->home_phone; emit homePhoneChanged(); } - if (user->workphone) { - m_workPhone = user->workphone; + if (user->work_phone) { + m_workPhone = user->work_phone; emit workPhoneChanged(); } - if (user->mobilephone) { - m_mobilePhone = user->mobilephone; + if (user->mobile_phone) { + m_mobilePhone = user->mobile_phone; emit mobilePhoneChanged(); } - if (user->pagerphone) { - m_pagerPhone = user->pagerphone; + if (user->pager_phone) { + m_pagerPhone = user->pager_phone; emit pagerPhoneChanged(); } if (user->gecos) { @@ -272,8 +272,8 @@ namespace RTClient { emit gecosChanged(); } if (user->timezone) { - m_timeZone = user->timezone; - emit timeZoneChanged(); + m_timezone = user->timezone; + emit timezoneChanged(); } if (user->lang) { m_lang = user->lang; @@ -310,8 +310,8 @@ namespace RTClient { m_comments = ""; m_signature = ""; m_gecos = ""; - m_lang = RTCLIENT_LANG_NONE; - m_timeZone = RTCLIENT_TIMEZONE_NONE; + m_lang = RTCLIENT_USER_LANG_NONE; + m_timezone = RTCLIENT_USER_TIMEZONE_NONE; m_privileged = false; m_disabled = true; } |