diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5f2e1c9b..1596d2d3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,66 +1,68 @@ set(expandjsontest_SRCS expandjson.cpp) add_executable(expandjsontest ${expandjsontest_SRCS}) target_link_libraries(expandjsontest Qt5::Widgets ) # ==================================================================== # #TODO reactivate it #set(loadroomcachetest_SRCS loadroomcache.cpp) #add_executable(loadroomcachetest ${loadroomcachetest_SRCS}) #target_link_libraries(loadroomcachetest # Qt5::Widgets # #TODO remove kurlrequester # KF5::KIOWidgets # ) # ==================================================================== # set(messagemodelguitest_SRCS messagemodelgui.cpp) qt5_add_resources(messagemodelguitestresources ../src/apps/qml/qml.qrc messagemodelgui.qrc) add_executable(messagemodelguitest ${messagemodelguitest_SRCS} ${messagemodelguitestresources}) target_link_libraries(messagemodelguitest Qt5::Widgets Qt5::WebSockets libruqolacore ) # ==================================================================== # set(roommodelguitest_SRCS roommodelgui.cpp) qt5_add_resources(roommodelguitestresources ../src/apps/qml/qml.qrc messagemodelgui.qrc) add_executable(roommodelguitest ${roommodelguitest_SRCS} ${roommodelguitestresources}) target_link_libraries(roommodelguitest Qt5::Widgets Qt5::WebSockets libruqolacore ) # ==================================================================== # set(aboutdatatest_SRCS aboutdatatest.cpp) qt5_add_resources(aboutdatatestresources aboutdatatest.qrc ../src/apps/qml/qml.qrc ) add_executable(aboutdatatest ${aboutdatatest_SRCS} ${aboutdatatestresources}) target_link_libraries(aboutdatatest Qt5::Widgets Qt5::WebSockets libruqolacore ) # ==================================================================== # set(unicodeemoticongui_SRCS unicodeemoticongui.cpp) +qt5_add_resources(unicodeemoticongui_SRCS ../src/ruqolacore/ruqolacore.qrc) + add_executable(unicodeemoticongui ${unicodeemoticongui_SRCS}) target_link_libraries(unicodeemoticongui Qt5::Widgets libruqolacore ) diff --git a/tests/unicodeemoticongui.cpp b/tests/unicodeemoticongui.cpp index 937507cd..11365e4a 100644 --- a/tests/unicodeemoticongui.cpp +++ b/tests/unicodeemoticongui.cpp @@ -1,55 +1,74 @@ /* Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "unicodeemoticongui.h" #include #include #include #include #include +#include +#include +#include + +#include UnicodeEmoticonGui::UnicodeEmoticonGui(QWidget *parent) : QWidget(parent) { QHBoxLayout *mainLayout = new QHBoxLayout(this); } UnicodeEmoticonGui::~UnicodeEmoticonGui() { } +void UnicodeEmoticonGui::load() +{ + UnicodeEmoticonParser unicodeParser; + QFile file(QStringLiteral(":/emoji.json")); + if (!file.open(QFile::ReadOnly)) { + qWarning() << "Impossible to open file: " << file.errorString(); + return; + } + const QJsonDocument doc = QJsonDocument::fromJson(file.readAll()); + + const QJsonObject obj = doc.object(); + const QVector unicodeEmojiList = unicodeParser.parse(obj); +} + void UnicodeEmoticonGui::save() { //TODO } int main(int argc, char *argv[]) { QApplication app(argc, argv); QStandardPaths::setTestModeEnabled(true); UnicodeEmoticonGui w; w.show(); return app.exec(); } diff --git a/tests/unicodeemoticongui.h b/tests/unicodeemoticongui.h index e4099947..68e58fb6 100644 --- a/tests/unicodeemoticongui.h +++ b/tests/unicodeemoticongui.h @@ -1,37 +1,38 @@ /* Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef UNICODEEMOTICONGUI_H #define UNICODEEMOTICONGUI_H #include class UnicodeEmoticonGui : public QWidget { Q_OBJECT public: explicit UnicodeEmoticonGui(QWidget *parent = nullptr); ~UnicodeEmoticonGui(); private: void save(); + void load(); }; #endif // UnicodeEmoticonGui_H