diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 58b60ab35..8f798aafe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ add_subdirectory(libneochat) add_subdirectory(login) add_subdirectory(rooms) add_subdirectory(timeline) +add_subdirectory(spaces) add_library(neochat STATIC controller.cpp @@ -19,12 +20,6 @@ add_library(neochat STATIC roommanager.h models/userfiltermodel.cpp models/userfiltermodel.h - models/spacechildrenmodel.cpp - models/spacechildrenmodel.h - models/spacechildsortfiltermodel.cpp - models/spacechildsortfiltermodel.h - models/spacetreeitem.cpp - models/spacetreeitem.h models/userdirectorylistmodel.cpp models/userdirectorylistmodel.h notificationsmanager.cpp @@ -132,8 +127,6 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE qml/RoomInformation.qml qml/RoomMedia.qml qml/ChooseRoomDialog.qml - qml/SpaceHomePage.qml - qml/SpaceHierarchyDelegate.qml qml/RemoveChildDialog.qml qml/SelectParentDialog.qml qml/QrCodeMaximizeComponent.qml @@ -167,6 +160,7 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE org.kde.neochat.libneochat org.kde.neochat.rooms org.kde.neochat.timeline + org.kde.neochat.spaces org.kde.neochat.settings org.kde.neochat.devtools org.kde.neochat.login @@ -234,7 +228,7 @@ else() endif() target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models) -target_link_libraries(neochat PRIVATE Settingsplugin Roomsplugin Timelineplugin devtoolsplugin Loginplugin chatbarplugin) +target_link_libraries(neochat PRIVATE Settingsplugin Roomsplugin Timelineplugin Spacesplugin devtoolsplugin Loginplugin chatbarplugin) target_link_libraries(neochat PUBLIC LibNeoChat Timeline @@ -258,6 +252,7 @@ target_link_libraries(neochat PUBLIC QuotientQt6 Login Rooms + Spaces ) if (TARGET KF6::Crash) diff --git a/src/spaces/CMakeLists.txt b/src/spaces/CMakeLists.txt new file mode 100644 index 000000000..f83169485 --- /dev/null +++ b/src/spaces/CMakeLists.txt @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2024 James Graham +# SPDX-License-Identifier: BSD-2-Clause + +qt_add_library(Spaces STATIC) +ecm_add_qml_module(Spaces GENERATE_PLUGIN_SOURCE + URI org.kde.neochat.spaces + OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/spaces + QML_FILES + SpaceHomePage.qml + SpaceHierarchyDelegate.qml + SOURCES + models/spacechildrenmodel.cpp + models/spacechildsortfiltermodel.cpp + models/spacetreeitem.cpp +) + +target_include_directories(Spaces PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models) +target_link_libraries(Spaces PRIVATE + Qt::Core + Qt::Quick + KF6::Kirigami + LibNeoChat +) diff --git a/src/qml/SpaceHierarchyDelegate.qml b/src/spaces/SpaceHierarchyDelegate.qml similarity index 100% rename from src/qml/SpaceHierarchyDelegate.qml rename to src/spaces/SpaceHierarchyDelegate.qml diff --git a/src/qml/SpaceHomePage.qml b/src/spaces/SpaceHomePage.qml similarity index 100% rename from src/qml/SpaceHomePage.qml rename to src/spaces/SpaceHomePage.qml diff --git a/src/models/spacechildrenmodel.cpp b/src/spaces/models/spacechildrenmodel.cpp similarity index 100% rename from src/models/spacechildrenmodel.cpp rename to src/spaces/models/spacechildrenmodel.cpp diff --git a/src/models/spacechildrenmodel.h b/src/spaces/models/spacechildrenmodel.h similarity index 100% rename from src/models/spacechildrenmodel.h rename to src/spaces/models/spacechildrenmodel.h diff --git a/src/models/spacechildsortfiltermodel.cpp b/src/spaces/models/spacechildsortfiltermodel.cpp similarity index 100% rename from src/models/spacechildsortfiltermodel.cpp rename to src/spaces/models/spacechildsortfiltermodel.cpp diff --git a/src/models/spacechildsortfiltermodel.h b/src/spaces/models/spacechildsortfiltermodel.h similarity index 100% rename from src/models/spacechildsortfiltermodel.h rename to src/spaces/models/spacechildsortfiltermodel.h diff --git a/src/models/spacetreeitem.cpp b/src/spaces/models/spacetreeitem.cpp similarity index 100% rename from src/models/spacetreeitem.cpp rename to src/spaces/models/spacetreeitem.cpp diff --git a/src/models/spacetreeitem.h b/src/spaces/models/spacetreeitem.h similarity index 100% rename from src/models/spacetreeitem.h rename to src/spaces/models/spacetreeitem.h