refactor(tree): give the logic layer and the shell a folder each
src/ and include/ are what is left: the controller the screens delegate to, its workers and its data model (core/), and the window and entry point that hold them together (app/). With those moved, src/ and include/ are empty and go away — a header is now always next to its source, in a folder named after what it does.
This commit is contained in:
10 files changed
+22
-22
No files matched your search
+22
-22
@@ -28,22 +28,22 @@ find_package(ZLIB REQUIRED)
|
||||
|
||||
# Main executable
|
||||
set(SOURCES
|
||||
src/main.cpp
|
||||
src/main-window.cpp
|
||||
app/main.cpp
|
||||
app/main-window.cpp
|
||||
providers/pacman-manager.cpp
|
||||
plugins/plugin-manager.cpp
|
||||
history/history-manager.cpp
|
||||
src/package-model.cpp
|
||||
core/package-model.cpp
|
||||
update/update-manager.cpp
|
||||
logging/app-logging.cpp
|
||||
preferences/app-settings.cpp
|
||||
preferences/language-manager.cpp
|
||||
# Logic layer: background workers, the plugin package installer and the
|
||||
# controller the screens delegate to.
|
||||
src/workers.cpp
|
||||
core/workers.cpp
|
||||
archive/zip-archive.cpp
|
||||
plugins/plugin-package.cpp
|
||||
src/app-core.cpp
|
||||
core/app-core.cpp
|
||||
# Interface: one file per screen under pages/, on top of the logic layer.
|
||||
pages/page.cpp
|
||||
pages/ui-kit.cpp
|
||||
@@ -63,18 +63,18 @@ set(HEADERS
|
||||
providers/pacman-manager.h
|
||||
plugins/plugin-manager.h
|
||||
include/sdk/provider-plugin.h
|
||||
include/main-window.h
|
||||
app/main-window.h
|
||||
history/history-manager.h
|
||||
include/package-model.h
|
||||
core/package-model.h
|
||||
update/update-manager.h
|
||||
logging/app-logging.h
|
||||
preferences/app-settings.h
|
||||
preferences/language-manager.h
|
||||
include/workers.h
|
||||
core/workers.h
|
||||
include/sdk/progress-tracker.h
|
||||
archive/zip-archive.h
|
||||
plugins/plugin-package.h
|
||||
include/app-core.h
|
||||
core/app-core.h
|
||||
logging/log-manager.h
|
||||
pages/page.h
|
||||
pages/ui-kit.h
|
||||
@@ -90,7 +90,7 @@ set(HEADERS
|
||||
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
include pages include/sdk logging preferences history archive update plugins providers)
|
||||
include pages include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Network ZLIB::ZLIB)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}"
|
||||
@@ -156,7 +156,7 @@ install(DIRECTORY include/sdk/ DESTINATION include/${PROJECT_NAME})
|
||||
# Tests
|
||||
enable_testing()
|
||||
add_executable(pacman-manager-test tests/pacman-manager.test.cpp providers/pacman-manager.cpp)
|
||||
target_include_directories(pacman-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(pacman-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
add_test(NAME pacman-manager-test COMMAND pacman-manager-test)
|
||||
|
||||
add_executable(flatpak-manager-test tests/flatpak-manager.test.cpp
|
||||
@@ -172,13 +172,13 @@ target_include_directories(flatpak-integration-test PRIVATE include include/sdk
|
||||
add_test(NAME flatpak-integration-test COMMAND flatpak-integration-test)
|
||||
|
||||
add_executable(package-utils-test tests/package-utils.test.cpp)
|
||||
target_include_directories(package-utils-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(package-utils-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
add_test(NAME package-utils-test COMMAND package-utils-test)
|
||||
|
||||
# ProgressTracker is pure logic (it only reads output lines), so it is tested
|
||||
# without a package manager, a display or even Qt.
|
||||
add_executable(progress-tracker-test tests/progress-tracker.test.cpp)
|
||||
target_include_directories(progress-tracker-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(progress-tracker-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
add_test(NAME progress-tracker-test COMMAND progress-tracker-test)
|
||||
|
||||
# PluginPackage: the .fwspacm format. The archives are built in the test itself
|
||||
@@ -188,7 +188,7 @@ add_test(NAME progress-tracker-test COMMAND progress-tracker-test)
|
||||
add_executable(plugin-package-test tests/plugin-package.test.cpp
|
||||
plugins/plugin-package.cpp archive/zip-archive.cpp logging/app-logging.cpp
|
||||
plugins/plugin-package.h archive/zip-archive.h)
|
||||
target_include_directories(plugin-package-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(plugin-package-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(plugin-package-test PRIVATE Qt6::Core ZLIB::ZLIB)
|
||||
add_test(NAME plugin-package-test COMMAND plugin-package-test)
|
||||
|
||||
@@ -204,14 +204,14 @@ add_test(NAME aur-manager-test COMMAND aur-manager-test)
|
||||
# The Q_OBJECT headers are listed explicitly so AUTOMOC generates their moc
|
||||
# file for this target (same reason as update-manager-test below).
|
||||
add_executable(app-core-test tests/app-core.test.cpp
|
||||
src/app-core.cpp src/workers.cpp providers/pacman-manager.cpp
|
||||
core/app-core.cpp core/workers.cpp providers/pacman-manager.cpp
|
||||
plugins/plugin-manager.cpp history/history-manager.cpp update/update-manager.cpp
|
||||
plugins/plugin-package.cpp archive/zip-archive.cpp
|
||||
logging/app-logging.cpp logging/log-manager.cpp preferences/app-settings.cpp
|
||||
include/app-core.h include/workers.h update/update-manager.h
|
||||
core/app-core.h core/workers.h update/update-manager.h
|
||||
plugins/plugin-package.h archive/zip-archive.h logging/log-manager.h
|
||||
preferences/app-settings.h)
|
||||
target_include_directories(app-core-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(app-core-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(app-core-test PRIVATE Qt6::Core Qt6::Network ZLIB::ZLIB)
|
||||
target_compile_definitions(app-core-test PRIVATE
|
||||
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}")
|
||||
@@ -223,7 +223,7 @@ add_test(NAME app-core-test COMMAND app-core-test)
|
||||
add_executable(app-settings-test tests/app-settings.test.cpp
|
||||
preferences/app-settings.cpp logging/log-manager.cpp preferences/app-settings.h
|
||||
logging/log-manager.h)
|
||||
target_include_directories(app-settings-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(app-settings-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(app-settings-test PRIVATE Qt6::Core)
|
||||
add_test(NAME app-settings-test COMMAND app-settings-test)
|
||||
|
||||
@@ -235,7 +235,7 @@ add_executable(language-manager-test tests/language-manager.test.cpp
|
||||
preferences/language-manager.cpp preferences/app-settings.cpp
|
||||
preferences/language-manager.h preferences/app-settings.h
|
||||
resources/resources.qrc)
|
||||
target_include_directories(language-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(language-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(language-manager-test PRIVATE Qt6::Core)
|
||||
# The resources come along so the test reads the catalogue exactly where the
|
||||
# application does, compiled in, rather than a copy that could drift.
|
||||
@@ -281,7 +281,7 @@ endif()
|
||||
|
||||
add_executable(update-manager-test tests/update-manager.test.cpp
|
||||
update/update-manager.cpp logging/app-logging.cpp update/update-manager.h)
|
||||
target_include_directories(update-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(update-manager-test PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
target_link_libraries(update-manager-test PRIVATE Qt6::Core Qt6::Network)
|
||||
target_compile_definitions(update-manager-test PRIVATE
|
||||
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}")
|
||||
@@ -344,7 +344,7 @@ endif()
|
||||
|
||||
if(FWS_BUILD_EXAMPLE_PLUGIN)
|
||||
add_library(example-provider-plugin MODULE plugins/example-provider/example-provider.cpp)
|
||||
target_include_directories(example-provider-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(example-provider-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
set_target_properties(example-provider-plugin PROPERTIES
|
||||
OUTPUT_NAME "sample-provider"
|
||||
CXX_STANDARD 17
|
||||
@@ -357,7 +357,7 @@ endif()
|
||||
|
||||
if(FWS_BUILD_EXAMPLE_ADDON)
|
||||
add_library(example-addon-plugin MODULE plugins/example-addon/example-addon.cpp)
|
||||
target_include_directories(example-addon-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers)
|
||||
target_include_directories(example-addon-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers core app)
|
||||
# The demo addon attaches Qt widgets, so it links the widget module like
|
||||
# the host application.
|
||||
target_link_libraries(example-addon-plugin PRIVATE Qt6::Widgets)
|
||||
|
||||
Reference in new issue
Block a user