Timeline Module

Move all the timeline QML files into their own QML module. Having them all in the same location is annoying and hard to work with.
This commit is contained in:
James Graham
2024-03-18 18:39:59 +00:00
parent 51d354a9c8
commit 6f9a273d39
36 changed files with 47 additions and 40 deletions

View File

@@ -213,19 +213,6 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/RoomData.qml
qml/ServerData.qml
qml/EmojiPicker.qml
qml/TimelineDelegate.qml
qml/ReplyComponent.qml
qml/StateDelegate.qml
qml/MessageDelegate.qml
qml/Bubble.qml
qml/SectionDelegate.qml
qml/ReactionDelegate.qml
qml/EventDelegate.qml
qml/ReadMarkerDelegate.qml
qml/MimeComponent.qml
qml/StateComponent.qml
qml/MessageEditComponent.qml
qml/AvatarFlow.qml
qml/LoginStep.qml
qml/Login.qml
qml/Homeserver.qml
@@ -310,24 +297,10 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/SelectSpacesDialog.qml
qml/AttachDialog.qml
qml/NotificationsView.qml
qml/LoadingDelegate.qml
qml/TimelineEndDelegate.qml
qml/SearchPage.qml
qml/ServerComboBox.qml
qml/UserSearchPage.qml
qml/ManualUserDialog.qml
qml/MessageComponentChooser.qml
qml/TextComponent.qml
qml/ImageComponent.qml
qml/VideoComponent.qml
qml/AudioComponent.qml
qml/EncryptedComponent.qml
qml/FileComponent.qml
qml/LocationComponent.qml
qml/LiveLocationComponent.qml
qml/PollComponent.qml
qml/LinkPreviewComponent.qml
qml/LoadComponent.qml
qml/RecommendedSpaceDialog.qml
qml/RoomTreeSection.qml
qml/DelegateContextMenu.qml
@@ -336,14 +309,13 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/IgnoredUsersDialog.qml
qml/AccountData.qml
qml/StateKeys.qml
qml/CodeComponent.qml
qml/QuoteComponent.qml
qml/ItineraryComponent.qml
RESOURCES
qml/confetti.png
qml/glowdot.png
)
add_subdirectory(timeline)
if(UNIX)
qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml)
else()
@@ -434,6 +406,7 @@ if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
endif()
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models ${CMAKE_CURRENT_SOURCE_DIR}/enums)
target_link_libraries(neochat PRIVATE timelineplugin)
target_link_libraries(neochat PUBLIC
Qt::Core
Qt::Quick

View File

@@ -11,6 +11,7 @@
#include <QQmlNetworkAccessManagerFactory>
#include <QQuickStyle>
#include <QQuickWindow>
#include <QtQml/QQmlExtensionPlugin>
#ifdef Q_OS_ANDROID
#include <QGuiApplication>
@@ -222,6 +223,8 @@ int main(int argc, char *argv[])
KDBusService service(KDBusService::Unique);
#endif
Q_IMPORT_QML_PLUGIN(org_kde_neochat_timelinePlugin)
qml_register_types_org_kde_neochat();
qmlRegisterSingletonInstance("org.kde.neochat.config", 1, 0, "Config", NeoChatConfig::self());
qmlRegisterSingletonInstance("org.kde.neochat.accounts", 1, 0, "AccountRegistry", &Controller::instance().accounts());

View File

@@ -7,6 +7,7 @@ import QtQuick.Layouts
import Qt.labs.qmlmodels
import org.kde.neochat
import org.kde.neochat.timeline
/**
* @brief Component for visualising the loaded media items in the room.

View File

@@ -4,6 +4,7 @@
import QtQuick
import org.kde.neochat
import org.kde.neochat.timeline
/**
* @brief Component for finding messages in a room.

View File

@@ -13,6 +13,7 @@ import org.kde.kitemmodels
import org.kde.neochat
import org.kde.neochat.config
import org.kde.neochat.timeline
QQC2.ScrollView {
id: root

View File

@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
# SPDX-License-Identifier: BSD-2-Clause
qt_add_library(timeline STATIC)
qt_add_qml_module(timeline
URI org.kde.neochat.timeline
QML_FILES
EventDelegate.qml
TimelineDelegate.qml
MessageDelegate.qml
LoadingDelegate.qml
ReadMarkerDelegate.qml
StateDelegate.qml
TimelineEndDelegate.qml
Bubble.qml
AvatarFlow.qml
ReactionDelegate.qml
SectionDelegate.qml
MessageComponentChooser.qml
AudioComponent.qml
CodeComponent.qml
EncryptedComponent.qml
FileComponent.qml
ImageComponent.qml
ItineraryComponent.qml
LinkPreviewComponent.qml
LiveLocationComponent.qml
LoadComponent.qml
LocationComponent.qml
MessageEditComponent.qml
MimeComponent.qml
PollComponent.qml
QuoteComponent.qml
ReplyComponent.qml
StateComponent.qml
TextComponent.qml
VideoComponent.qml
)

View File

@@ -8,8 +8,6 @@ import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.neochat
/**
* @brief A component to show a link preview from a message.
*/

View File

@@ -5,8 +5,6 @@ import QtQuick
import org.kde.kirigami as Kirigami
import org.kde.neochat
TimelineDelegate {
id: root
contentItem: Kirigami.PlaceholderMessage {

View File

@@ -8,8 +8,6 @@ import QtQuick.Layouts
import Qt.labs.qmlmodels
import org.kde.kirigami as Kirigami
import org.kde.neochat
TimelineDelegate {
id: root
contentItem: QQC2.ItemDelegate {

View File

@@ -8,7 +8,6 @@ import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.neochat
import org.kde.neochat.config
QQC2.ItemDelegate {

View File

@@ -8,8 +8,6 @@ import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
import org.kde.neochat
/**
* @brief A component for visualising a single state event
*/

View File

@@ -8,7 +8,6 @@ import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
import org.kde.neochat
import org.kde.neochat.config
/**