From 14e1d2d162244bc43d716f54fc184f4378f35714 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 3 Mar 2024 01:59:31 -0800 Subject: [PATCH] refactor: move socket and datastream types to Io module --- CMakeLists.txt | 1 + docs | 2 +- src/core/CMakeLists.txt | 9 --------- src/core/module.md | 2 -- src/io/CMakeLists.txt | 16 ++++++++++++++++ src/{core => io}/datastream.cpp | 0 src/{core => io}/datastream.hpp | 0 src/io/module.md | 7 +++++++ src/{core => io}/socket.cpp | 0 src/{core => io}/socket.hpp | 2 +- src/{core => io}/test/CMakeLists.txt | 0 src/{core => io}/test/datastream.cpp | 0 12 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 src/io/CMakeLists.txt rename src/{core => io}/datastream.cpp (100%) rename src/{core => io}/datastream.hpp (100%) create mode 100644 src/io/module.md rename src/{core => io}/socket.cpp (100%) rename src/{core => io}/socket.hpp (99%) rename src/{core => io}/test/CMakeLists.txt (100%) rename src/{core => io}/test/datastream.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a917f9c..c0da8169 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS}) qt_standard_project_setup(REQUIRES 6.6) add_subdirectory(src/core) +add_subdirectory(src/io) if (WAYLAND) add_subdirectory(src/wayland) diff --git a/docs b/docs index 5aaacb9a..79579222 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 5aaacb9a1eea9086d6da9e21eed6e30456c6c5d6 +Subproject commit 79579222a31dc1f6355e0c3020917c29165f766c diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3442405e..a41f52ce 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -15,17 +15,8 @@ qt_add_executable(quickshell windowinterface.cpp floatingwindow.cpp panelinterface.cpp - datastream.cpp ) qt_add_qml_module(quickshell URI Quickshell) -if (SOCKETS) - target_sources(quickshell PRIVATE socket.cpp) -endif() - target_link_libraries(quickshell PRIVATE ${QT_DEPS}) - -if (TESTS) - add_subdirectory(test) -endif() diff --git a/src/core/module.md b/src/core/module.md index b94d4916..70b2c8c8 100644 --- a/src/core/module.md +++ b/src/core/module.md @@ -12,7 +12,5 @@ headers = [ "windowinterface.hpp", "panelinterface.hpp", "floatingwindow.hpp", - "datastream.hpp", - "socket.hpp", ] ----- diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt new file mode 100644 index 00000000..b3b2c771 --- /dev/null +++ b/src/io/CMakeLists.txt @@ -0,0 +1,16 @@ +qt_add_library(quickshell-io STATIC + datastream.cpp +) + +if (SOCKETS) + target_sources(quickshell-io PRIVATE socket.cpp) +endif() + +qt_add_qml_module(quickshell-io URI Quickshell.Io) +target_link_libraries(quickshell-io PRIVATE ${QT_DEPS}) + +target_link_libraries(quickshell PRIVATE quickshell-ioplugin) + +if (TESTS) + add_subdirectory(test) +endif() diff --git a/src/core/datastream.cpp b/src/io/datastream.cpp similarity index 100% rename from src/core/datastream.cpp rename to src/io/datastream.cpp diff --git a/src/core/datastream.hpp b/src/io/datastream.hpp similarity index 100% rename from src/core/datastream.hpp rename to src/io/datastream.hpp diff --git a/src/io/module.md b/src/io/module.md new file mode 100644 index 00000000..cbcd322a --- /dev/null +++ b/src/io/module.md @@ -0,0 +1,7 @@ +name = "Quickshell.Io" +description = "Io types" +headers = [ + "datastream.hpp", + "socket.hpp", +] +----- diff --git a/src/core/socket.cpp b/src/io/socket.cpp similarity index 100% rename from src/core/socket.cpp rename to src/io/socket.cpp diff --git a/src/core/socket.hpp b/src/io/socket.hpp similarity index 99% rename from src/core/socket.hpp rename to src/io/socket.hpp index 6a390b03..4fcf16b6 100644 --- a/src/core/socket.hpp +++ b/src/io/socket.hpp @@ -9,7 +9,7 @@ #include #include "datastream.hpp" -#include "reload.hpp" +#include "../core/reload.hpp" ///! Unix socket listener. class Socket: public DataStream { diff --git a/src/core/test/CMakeLists.txt b/src/io/test/CMakeLists.txt similarity index 100% rename from src/core/test/CMakeLists.txt rename to src/io/test/CMakeLists.txt diff --git a/src/core/test/datastream.cpp b/src/io/test/datastream.cpp similarity index 100% rename from src/core/test/datastream.cpp rename to src/io/test/datastream.cpp