diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 49fff1c7..2387e3ae 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,72 +1,23 @@ 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 - ) - # ==================================================================== # find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ItemViews ) 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 KF5::ItemViews libruqolacore ) diff --git a/tests/aboutdatatest.cpp b/tests/aboutdatatest.cpp deleted file mode 100644 index 452359ba..00000000 --- a/tests/aboutdatatest.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (c) 2017-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 "aboutdatatest.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QStandardPaths::setTestModeEnabled(true); - - KAboutData aboutData(QStringLiteral("ruqola"), - QStringLiteral("Ruqola"), - QStringLiteral("1.0.0"), - QStringLiteral("Rocket Chat Client"), - KAboutLicense::GPL_V2, - QStringLiteral("Copyright © 2017 Ruqola authors")); - - aboutData.addAuthor(QStringLiteral("Laurent Montel"), QStringLiteral("Maintainer"), QStringLiteral("montel@kde.org")); - aboutData.addAuthor(QStringLiteral("Riccardo Iaconelli"), QStringLiteral("Original author"), QStringLiteral("riccardo@kde.org")); - aboutData.addAuthor(QStringLiteral("Vasudha Mathur"), QStringLiteral("Former core developer"), QStringLiteral("vasudhamathur96@gmail.com")); - //Add credit - //aboutData.addCredit(QStringLiteral("Laurent Montel"), QStringLiteral("Maintainer"), QStringLiteral("montel@kde.org")); - - aboutData.setTranslator(QStringLiteral("Laurent Montel"), QStringLiteral("montel@kde.org")); - - aboutData.setOrganizationDomain(QByteArrayLiteral("kde.org")); - aboutData.setProductName(QByteArrayLiteral("ruqola")); - KAboutData::setApplicationData(aboutData); - - QCommandLineParser parser; - aboutData.setupCommandLine(&parser); - parser.process(app); - aboutData.processCommandLine(&parser); - - qmlRegisterSingletonType("KDE.Ruqola.Ruqola", 1, 0, "Ruqola", ruqola_singletontype_provider); - qmlRegisterSingletonType("KDE.Ruqola.RuqolaUtils", 1, 0, "RuqolaUtils", ruqolautils_singletontype_provider); - qmlRegisterType("KDE.Ruqola.RuqolaAboutData", 1, 0, "RuqolaAboutData"); - qmlRegisterType("KDE.Ruqola.RuqolaAboutDataAuthorModel", 1, 0, "RuqolaAboutDataAuthorModel"); - - QmlAboutData ruqolaAboutData; - - QQmlApplicationEngine engine; - QQmlContext *ctxt = engine.rootContext(); - ctxt->setContextObject(new KLocalizedContext(&engine)); - ctxt->setContextProperty(QStringLiteral("ruqolaAboutData"), &ruqolaAboutData); - - engine.load(QUrl(QStringLiteral("qrc:/aboutdata.qml"))); - return app.exec(); -} diff --git a/tests/aboutdatatest.h b/tests/aboutdatatest.h deleted file mode 100644 index 38a4f82e..00000000 --- a/tests/aboutdatatest.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (c) 2017-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 ABOUTDATATEST_H -#define ABOUTDATATEST_H - -#endif // ABOUTDATATEST_H diff --git a/tests/aboutdatatest.qrc b/tests/aboutdatatest.qrc deleted file mode 100644 index 828ba4d4..00000000 --- a/tests/aboutdatatest.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - qml/aboutdata.qml - - diff --git a/tests/messagemodelgui.cpp b/tests/messagemodelgui.cpp deleted file mode 100644 index 916d9dc2..00000000 --- a/tests/messagemodelgui.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - Copyright (c) 2017-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 "messagemodelgui.h" - -#include -#include -#include "model/messagemodel.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MessageModelGui::MessageModelGui(QWidget *parent) - : QWidget(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - mTextEdit = new QTextEdit(this); - mTextEdit->setAcceptRichText(false); - layout->addWidget(mTextEdit); - QPushButton *button = new QPushButton(QStringLiteral("Send Message"), this); - layout->addWidget(button); - connect(button, &QPushButton::clicked, this, &MessageModelGui::sendMessage); - - fillModel(); - qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/ExtraColors.qml")), "KDE.Ruqola.ExtraColors", 1, 0, "RuqolaSingleton"); - qmlRegisterSingletonType("KDE.Ruqola.RuqolaUtils", 1, 0, "RuqolaUtils", ruqolautils_singletontype_provider); - qmlRegisterSingletonType("KDE.Ruqola.Ruqola", 1, 0, "Ruqola", ruqola_singletontype_provider); - qmlRegisterType("KDE.Ruqola.RoomFilterProxyModel", 1, 0, "RoomFilterProxyModel"); - qmlRegisterType("KDE.Ruqola.RocketChatAccount", 1, 0, "RocketChatAccount"); - qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/DebugCategory.qml")), "KDE.Ruqola.DebugCategory", 1, 0, "RuqolaDebugCategorySingleton"); - qRegisterMetaType(); - qmlRegisterUncreatableType("KDE.Ruqola.Message", 1, 0, "Message", QStringLiteral("MessageType is an enum container")); - mEngine = new QQmlApplicationEngine(this); - - QQmlContext *ctxt = mEngine->rootContext(); - ctxt->setContextObject(new KLocalizedContext(mEngine)); - ctxt->setContextProperty(QStringLiteral("messageModel"), mModel); - - mEngine->load(QUrl(QStringLiteral("qrc:/messagemodelgui.qml"))); -} - -void MessageModelGui::sendMessage() -{ - QString str = mTextEdit->toPlainText(); - if (str.isEmpty()) { - return; - } - Message m1; - m1.setMessageType(Message::MessageType::NormalText); - m1.setMessageId(QString::number(mIndexMessage++)); - m1.setText(str); - m1.setUsername(QStringLiteral("blabla")); - m1.setTimeStamp(QDateTime::currentDateTime().toMSecsSinceEpoch()); - m1.setAlias(QStringLiteral("bla")); - mModel->addMessage(m1); -} - -void MessageModelGui::fillModel() -{ - mIndexMessage = 1; - mModel = new MessageModel(); - Message m1; - m1.setMessageType(Message::MessageType::NormalText); - m1.setMessageId(QString::number(mIndexMessage++)); - m1.setText(QStringLiteral("foo")); - m1.setUsername(QStringLiteral("blabla")); - m1.setTimeStamp(QDateTime(QDate(2017, 3, 3), QTime(11, 30, 00)).toMSecsSinceEpoch()); - m1.setAlias(QStringLiteral("bla")); - - mModel->addMessage(m1); - Message m2; - m2.setMessageType(Message::MessageType::NormalText); - m2.setMessageId(QString::number(mIndexMessage++)); - m2.setText(QStringLiteral("bla bla bla bla bla bla")); - m2.setTimeStamp(QDateTime(QDate(2017, 3, 3), QTime(11, 31, 00)).toMSecsSinceEpoch()); - m2.setUsername(QStringLiteral("blo")); - m2.setAlias(QStringLiteral("bla")); - mModel->addMessage(m2); - - Message m3; - m3.setMessageType(Message::MessageType::NormalText); - m3.setMessageId(QString::number(mIndexMessage++)); - m3.setText(QStringLiteral("next day")); - m3.setTimeStamp(QDateTime(QDate(2017, 03, 04), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m3.setUsername(QStringLiteral("blo")); - m3.setAlias(QStringLiteral("bla")); - mModel->addMessage(m3); - - //System message - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("uj")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("uj")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("ul")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("ul")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("room_changed_topic")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("au")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("r")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("room_changed_description")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("room_changed_privacy")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_announcement")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("room_changed_announcement")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("sss")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("ru")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 9), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("jitsi_call_started")); - mModel->addMessage(m4); - } - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 9), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("message_pinned")); - mModel->addMessage(m4); - } - - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("rm")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 9), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("rm")); - mModel->addMessage(m4); - } - - //Otr - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("rm")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 9), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setSystemMessageType(QStringLiteral("otr")); - mModel->addMessage(m4); - } - - //Video - { - Message m4; - m4.setMessageType(Message::MessageType::Video); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - mModel->addMessage(m4); - } - - //Audio - { - Message m4; - m4.setMessageType(Message::MessageType::Audio); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("room_changed_topic")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - mModel->addMessage(m4); - } - - //Change roles - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("subscription-role-added")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setRole(QStringLiteral("leader")); - mModel->addMessage(m4); - } - //Remove roles - { - Message m4; - m4.setMessageType(Message::MessageType::System); - m4.setMessageId(QString::number(mIndexMessage++)); - m4.setText(QStringLiteral("subscription-role-removed")); - m4.setTimeStamp(QDateTime(QDate(2017, 3, 5), QTime(11, 31, 0)).toMSecsSinceEpoch()); - m4.setUsername(QStringLiteral("blo")); - m4.setAlias(QStringLiteral("bla")); - m4.setRole(QStringLiteral("leader")); - mModel->addMessage(m4); - } - - //ADD more -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QStandardPaths::setTestModeEnabled(true); - - MessageModelGui w; - w.show(); - return app.exec(); -} diff --git a/tests/messagemodelgui.h b/tests/messagemodelgui.h deleted file mode 100644 index d0396b32..00000000 --- a/tests/messagemodelgui.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 2017-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 MESSAGEMODELGUI_H -#define MESSAGEMODELGUI_H - -#include -class QQmlApplicationEngine; -class MessageModel; -class QTextEdit; -class MessageModelGui : public QWidget -{ - Q_OBJECT -public: - explicit MessageModelGui(QWidget *parent = nullptr); - ~MessageModelGui() = default; -private: - void sendMessage(); - void fillModel(); - int mIndexMessage = 1; - QQmlApplicationEngine *mEngine = nullptr; - MessageModel *mModel = nullptr; - QTextEdit *mTextEdit = nullptr; -}; - -#endif // MESSAGEMODELGUI_H diff --git a/tests/messagemodelgui.qrc b/tests/messagemodelgui.qrc deleted file mode 100644 index 8ad9dadf..00000000 --- a/tests/messagemodelgui.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - qml/messagemodelgui.qml - qml/ActiveChat.qml - qml/DebugCategory.qml - - diff --git a/tests/qml/ActiveChat.qml b/tests/qml/ActiveChat.qml deleted file mode 100644 index 51a6b093..00000000 --- a/tests/qml/ActiveChat.qml +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 2017-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. -*/ - -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Layouts 1.12 - -import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.7 as Kirigami - -ListView { - id: activeChat - - property QtObject roomModel - - model: roomModel - - onCountChanged: { - positionViewAtIndex(count - 1, ListView.Beginning) - } - - Component.onCompleted: positionViewAtIndex(count - 1, ListView.End) - visible: count > 0 - - delegate: FancyMessageDelegate { - width: parent.width - i_messageText: messageConverted - i_username: username - i_usernameurl: usernameurl - i_aliasname: alias - i_systemMessageType: type - i_timestamp: timestamp - i_messageID: messageID - i_messageType: messagetype - i_avatar: avatar - i_urls: urls - i_attachments: attachments - i_date: date - } -} diff --git a/tests/qml/DebugCategory.qml b/tests/qml/DebugCategory.qml deleted file mode 100644 index 9f16aab2..00000000 --- a/tests/qml/DebugCategory.qml +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (c) 2017-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. -*/ - -pragma Singleton - -import QtQml 2.8 - -QtObject { - readonly property LoggingCategory category : LoggingCategory { - id: category - name: "org.kde.ruqola.qml" - } -} diff --git a/tests/qml/aboutdata.qml b/tests/qml/aboutdata.qml deleted file mode 100644 index 0eaf893a..00000000 --- a/tests/qml/aboutdata.qml +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (c) 2018-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. -*/ - -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Dialogs 1.2 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.5 as QQC2 - -import org.kde.kirigami 2.7 as Kirigami - -QQC2.ApplicationWindow { - id: window - - width: 600 - height: 800 - visible: true - title: "About Data Test" - - QQC2.Label { - text: "click for show aboutdata" - anchors.fill: parent - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - MouseArea { - anchors.fill: parent - onClicked: { - aboutDataDialog.open(); - } - } - } - - - AboutDialog { - id: aboutDataDialog - applicationData: ruqolaAboutData - onOpenurl: { - console.log("url clicked : " + link); - } - } - - QQC2.Menu { - id: contactMenu - x: parent.width / 2 - width / 2 - y: parent.height / 2 - height / 2 - modal: true - - MenuItem { - text: "AboutData" - onTriggered: { - } - } - } -} diff --git a/tests/qml/messagemodelgui.qml b/tests/qml/messagemodelgui.qml deleted file mode 100644 index 4fc24f7d..00000000 --- a/tests/qml/messagemodelgui.qml +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (c) 2018-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. -*/ - -import QtQuick 2.9 -import QtQuick.Layouts 1.12 - -import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.7 as Kirigami - -Kirigami.ApplicationWindow { - pageStack.initialPage: [roomsComponent] - - Component { - id: roomsComponent - Kirigami.ScrollablePage { - id: mainWidget - leftPadding: Kirigami.Units.smallSpacing - rightPadding: Kirigami.Units.smallSpacing - topPadding: Kirigami.Units.smallSpacing - bottomPadding: Kirigami.Units.smallSpacing - ActiveChat { - id: activeChat - model: messageModel - } - } - } -}