From d6a013b29ec9991994a757bbb13c7bb17561550b 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: Sat, 15 Jan 2022 18:55:39 +0800 Subject: Rename qrtclient/client.hxx to qrtclient.hxx --- CMakeLists.txt | 35 +++++++++++------------- client.cxx | 4 +-- qrtclient.hxx | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ qrtclient/client.hxx | 77 ---------------------------------------------------- user.cxx | 2 +- 5 files changed, 96 insertions(+), 99 deletions(-) create mode 100644 qrtclient.hxx delete mode 100644 qrtclient/client.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bee888..ba130f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,37 +1,34 @@ cmake_minimum_required(VERSION 3.5) - project(qrtclient) - set(CMAKE_AUTOMOC ON) - find_package(Qt5Core) - -add_library(${PROJECT_NAME} SHARED +set(HDRS ${PROJECT_NAME}/user.hxx ${PROJECT_NAME}/ticket.hxx ${PROJECT_NAME}/tickethistory.hxx - ${PROJECT_NAME}/client.hxx + ) +set(SRCS + ${PROJECT_NAME}.hxx + ${HDRS} user.cxx ticket.cxx tickethistory.cxx client.cxx ) - -if (APPLE) +if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") include_directories(/usr/local/include) - target_link_directories(${PROJECT_NAME} PRIVATE /usr/local/lib) + link_directories(/usr/local/lib) +endif() +if (EMSCRIPTEN OR IOS) + add_library(${PROJECT_NAME} STATIC ${SRCS}) +else() + add_library(${PROJECT_NAME} SHARED ${SRCS}) endif() - target_link_libraries(${PROJECT_NAME} Qt5::Core rtclient ) - -install(TARGETS ${PROJECT_NAME} DESTINATION lib) -install(FILES - ${PROJECT_NAME}/user.hxx - ${PROJECT_NAME}/ticket.hxx - ${PROJECT_NAME}/tickethistory.hxx - ${PROJECT_NAME}/client.hxx - DESTINATION include/${PROJECT_NAME} - ) +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES ${PROJECT_NAME}.hxx DESTINATION include) +install(FILES ${HDRS} DESTINATION include/${PROJECT_NAME}) diff --git a/client.cxx b/client.cxx index ed24ef2..4bf8169 100644 --- a/client.cxx +++ b/client.cxx @@ -1,8 +1,8 @@ #include -#include +#include #include #include -#include "qrtclient/client.hxx" +#include "qrtclient.hxx" namespace RTClient { diff --git a/qrtclient.hxx b/qrtclient.hxx new file mode 100644 index 0000000..e9e6b0f --- /dev/null +++ b/qrtclient.hxx @@ -0,0 +1,77 @@ +#ifndef QRTCLIENT_CLIENT_HXX +#define QRTCLIENT_CLIENT_HXX + +#include +#include + +struct rtclient_user; +struct rtclient_search_ticket_list; +struct rtclient_ticket_history_list; + +namespace RTClient { + + class Client : public QObject + { + Q_OBJECT + + public: + Client(char const* url, char const* certificate = nullptr); + ~Client(); + + public slots: + void logIn(QString const& name, QString const& password); + void userNew(QString const& name + , QString const& password + , QString const& emailAddress = nullptr + , QString const& realName = nullptr + , QString const& nickName = nullptr + , QString const& organization = nullptr + , QString const& address1 = nullptr + , QString const& address2 = nullptr + , QString const& city = nullptr + , QString const& state = nullptr + , QString const& zip = nullptr + , QString const& country = nullptr + , QString const& homePhone = nullptr + , QString const& workPhone = nullptr + , QString const& mobilePhone = nullptr + , QString const& pagerPhone = nullptr + , QString const& contactInfo = nullptr + , QString const& comments = nullptr + , QString const& signature = nullptr + , QString const& gecos = nullptr + , 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); + void userShow(QString const& name); + void ticketNew(QString const& queue = nullptr + , QString const& requestor = nullptr + , QString const& subject = nullptr + , QString const& cc = 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& starts = nullptr + , QString const& due = nullptr + , QString const& text = nullptr); + void searchTicket(QString const& owner); + void ticketHistory(int id, bool longFormat = false); + + signals: + void loggedIn(QString const& name); + void userShown(rtclient_user* user); + void searchedTicket(rtclient_search_ticket_list* list); + void gotTicketHistory(rtclient_ticket_history_list* list); + }; + +} + +#endif // QRTCLIENT_CLIENT_HXX diff --git a/qrtclient/client.hxx b/qrtclient/client.hxx deleted file mode 100644 index e9e6b0f..0000000 --- a/qrtclient/client.hxx +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef QRTCLIENT_CLIENT_HXX -#define QRTCLIENT_CLIENT_HXX - -#include -#include - -struct rtclient_user; -struct rtclient_search_ticket_list; -struct rtclient_ticket_history_list; - -namespace RTClient { - - class Client : public QObject - { - Q_OBJECT - - public: - Client(char const* url, char const* certificate = nullptr); - ~Client(); - - public slots: - void logIn(QString const& name, QString const& password); - void userNew(QString const& name - , QString const& password - , QString const& emailAddress = nullptr - , QString const& realName = nullptr - , QString const& nickName = nullptr - , QString const& organization = nullptr - , QString const& address1 = nullptr - , QString const& address2 = nullptr - , QString const& city = nullptr - , QString const& state = nullptr - , QString const& zip = nullptr - , QString const& country = nullptr - , QString const& homePhone = nullptr - , QString const& workPhone = nullptr - , QString const& mobilePhone = nullptr - , QString const& pagerPhone = nullptr - , QString const& contactInfo = nullptr - , QString const& comments = nullptr - , QString const& signature = nullptr - , QString const& gecos = nullptr - , 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); - void userShow(QString const& name); - void ticketNew(QString const& queue = nullptr - , QString const& requestor = nullptr - , QString const& subject = nullptr - , QString const& cc = 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& starts = nullptr - , QString const& due = nullptr - , QString const& text = nullptr); - void searchTicket(QString const& owner); - void ticketHistory(int id, bool longFormat = false); - - signals: - void loggedIn(QString const& name); - void userShown(rtclient_user* user); - void searchedTicket(rtclient_search_ticket_list* list); - void gotTicketHistory(rtclient_ticket_history_list* list); - }; - -} - -#endif // QRTCLIENT_CLIENT_HXX diff --git a/user.cxx b/user.cxx index 2f031e8..8a54e5f 100644 --- a/user.cxx +++ b/user.cxx @@ -1,5 +1,5 @@ #include -#include +#include #include "qrtclient/user.hxx" namespace RTClient { -- cgit v1.2.3