refactor(tree): move the journal and the preferences out of src/ and include/

The journal and the preferences were two of the many things src/ held, so
"where does this live" meant reading the file to find out. They now have a
folder each — logging/ and preferences/ — with the header next to its
source, the way pages/ has always been laid out.

Flat #include still resolves: the folders join the include path.
This commit is contained in:
BlackAngelTV committed 2026-09-29 21:24:27 +02:00
1 parent 91f88b1acc
commit 9c30268810
9 files changed
+37 -36

No files matched your search

+37 -36
View File
@@ -35,9 +35,9 @@ set(SOURCES
src/history-manager.cpp src/history-manager.cpp
src/package-model.cpp src/package-model.cpp
src/update-manager.cpp src/update-manager.cpp
src/app-logging.cpp logging/app-logging.cpp
src/app-settings.cpp preferences/app-settings.cpp
src/language-manager.cpp preferences/language-manager.cpp
# Logic layer: background workers, the plugin package installer and the # Logic layer: background workers, the plugin package installer and the
# controller the screens delegate to. # controller the screens delegate to.
src/workers.cpp src/workers.cpp
@@ -51,7 +51,7 @@ set(SOURCES
pages/browse-page.cpp pages/browse-page.cpp
pages/cleanup-page.cpp pages/cleanup-page.cpp
pages/history-page.cpp pages/history-page.cpp
src/log-manager.cpp logging/log-manager.cpp
pages/logs-page.cpp pages/logs-page.cpp
pages/plugins-page.cpp pages/plugins-page.cpp
pages/settings-page.cpp pages/settings-page.cpp
@@ -67,15 +67,15 @@ set(HEADERS
include/history-manager.h include/history-manager.h
include/package-model.h include/package-model.h
include/update-manager.h include/update-manager.h
include/app-logging.h logging/app-logging.h
include/app-settings.h preferences/app-settings.h
include/language-manager.h preferences/language-manager.h
include/workers.h include/workers.h
include/sdk/progress-tracker.h include/sdk/progress-tracker.h
include/zip-archive.h include/zip-archive.h
include/plugin-package.h include/plugin-package.h
include/app-core.h include/app-core.h
include/log-manager.h logging/log-manager.h
pages/page.h pages/page.h
pages/ui-kit.h pages/ui-kit.h
pages/dashboard-page.h pages/dashboard-page.h
@@ -89,7 +89,8 @@ set(HEADERS
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME} PRIVATE include pages include/sdk) target_include_directories(${PROJECT_NAME} PRIVATE
include pages include/sdk logging preferences)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Network ZLIB::ZLIB) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Network ZLIB::ZLIB)
target_compile_definitions(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}" FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}"
@@ -155,29 +156,29 @@ install(DIRECTORY include/sdk/ DESTINATION include/${PROJECT_NAME})
# Tests # Tests
enable_testing() enable_testing()
add_executable(pacman-manager-test tests/pacman-manager.test.cpp src/pacman-manager.cpp) add_executable(pacman-manager-test tests/pacman-manager.test.cpp src/pacman-manager.cpp)
target_include_directories(pacman-manager-test PRIVATE include include/sdk) target_include_directories(pacman-manager-test PRIVATE include include/sdk logging preferences)
add_test(NAME pacman-manager-test COMMAND pacman-manager-test) add_test(NAME pacman-manager-test COMMAND pacman-manager-test)
add_executable(flatpak-manager-test tests/flatpak-manager.test.cpp add_executable(flatpak-manager-test tests/flatpak-manager.test.cpp
plugins/flatpak-provider/flatpak-manager.cpp) plugins/flatpak-provider/flatpak-manager.cpp)
target_include_directories(flatpak-manager-test PRIVATE include include/sdk plugins/flatpak-provider) target_include_directories(flatpak-manager-test PRIVATE include include/sdk logging preferences plugins/flatpak-provider)
add_test(NAME flatpak-manager-test COMMAND flatpak-manager-test) add_test(NAME flatpak-manager-test COMMAND flatpak-manager-test)
# Real end-to-end test of the Flatpak provider against the live flatpak CLI # Real end-to-end test of the Flatpak provider against the live flatpak CLI
# (installs and uninstalls a small app). Skipped when flatpak is missing. # (installs and uninstalls a small app). Skipped when flatpak is missing.
add_executable(flatpak-integration-test tests/flatpak-integration.test.cpp add_executable(flatpak-integration-test tests/flatpak-integration.test.cpp
plugins/flatpak-provider/flatpak-manager.cpp) plugins/flatpak-provider/flatpak-manager.cpp)
target_include_directories(flatpak-integration-test PRIVATE include include/sdk plugins/flatpak-provider) target_include_directories(flatpak-integration-test PRIVATE include include/sdk logging preferences plugins/flatpak-provider)
add_test(NAME flatpak-integration-test COMMAND flatpak-integration-test) add_test(NAME flatpak-integration-test COMMAND flatpak-integration-test)
add_executable(package-utils-test tests/package-utils.test.cpp) add_executable(package-utils-test tests/package-utils.test.cpp)
target_include_directories(package-utils-test PRIVATE include include/sdk) target_include_directories(package-utils-test PRIVATE include include/sdk logging preferences)
add_test(NAME package-utils-test COMMAND package-utils-test) add_test(NAME package-utils-test COMMAND package-utils-test)
# ProgressTracker is pure logic (it only reads output lines), so it is tested # ProgressTracker is pure logic (it only reads output lines), so it is tested
# without a package manager, a display or even Qt. # without a package manager, a display or even Qt.
add_executable(progress-tracker-test tests/progress-tracker.test.cpp) add_executable(progress-tracker-test tests/progress-tracker.test.cpp)
target_include_directories(progress-tracker-test PRIVATE include include/sdk) target_include_directories(progress-tracker-test PRIVATE include include/sdk logging preferences)
add_test(NAME progress-tracker-test COMMAND progress-tracker-test) add_test(NAME progress-tracker-test COMMAND progress-tracker-test)
# PluginPackage: the .fwspacm format. The archives are built in the test itself # PluginPackage: the .fwspacm format. The archives are built in the test itself
@@ -185,15 +186,15 @@ add_test(NAME progress-tracker-test COMMAND progress-tracker-test)
# the file half runs in a temporary directory, and the settings go to a # the file half runs in a temporary directory, and the settings go to a
# temporary INI too, so nothing touches the user's real plugin directory. # temporary INI too, so nothing touches the user's real plugin directory.
add_executable(plugin-package-test tests/plugin-package.test.cpp add_executable(plugin-package-test tests/plugin-package.test.cpp
src/plugin-package.cpp src/zip-archive.cpp src/app-logging.cpp src/plugin-package.cpp src/zip-archive.cpp logging/app-logging.cpp
include/plugin-package.h include/zip-archive.h) include/plugin-package.h include/zip-archive.h)
target_include_directories(plugin-package-test PRIVATE include include/sdk) target_include_directories(plugin-package-test PRIVATE include include/sdk logging preferences)
target_link_libraries(plugin-package-test PRIVATE Qt6::Core ZLIB::ZLIB) target_link_libraries(plugin-package-test PRIVATE Qt6::Core ZLIB::ZLIB)
add_test(NAME plugin-package-test COMMAND plugin-package-test) add_test(NAME plugin-package-test COMMAND plugin-package-test)
add_executable(aur-manager-test tests/aur-manager.test.cpp add_executable(aur-manager-test tests/aur-manager.test.cpp
plugins/aur-provider/aur-manager.cpp) plugins/aur-provider/aur-manager.cpp)
target_include_directories(aur-manager-test PRIVATE include include/sdk plugins/aur-provider) target_include_directories(aur-manager-test PRIVATE include include/sdk logging preferences plugins/aur-provider)
add_test(NAME aur-manager-test COMMAND aur-manager-test) add_test(NAME aur-manager-test COMMAND aur-manager-test)
# UpdateManager::isNewerVersion is pure logic, but the file also pulls in Qt # UpdateManager::isNewerVersion is pure logic, but the file also pulls in Qt
@@ -206,11 +207,11 @@ add_executable(app-core-test tests/app-core.test.cpp
src/app-core.cpp src/workers.cpp src/pacman-manager.cpp src/app-core.cpp src/workers.cpp src/pacman-manager.cpp
src/plugin-manager.cpp src/history-manager.cpp src/update-manager.cpp src/plugin-manager.cpp src/history-manager.cpp src/update-manager.cpp
src/plugin-package.cpp src/zip-archive.cpp src/plugin-package.cpp src/zip-archive.cpp
src/app-logging.cpp src/log-manager.cpp src/app-settings.cpp logging/app-logging.cpp logging/log-manager.cpp preferences/app-settings.cpp
include/app-core.h include/workers.h include/update-manager.h include/app-core.h include/workers.h include/update-manager.h
include/plugin-package.h include/zip-archive.h include/log-manager.h include/plugin-package.h include/zip-archive.h logging/log-manager.h
include/app-settings.h) preferences/app-settings.h)
target_include_directories(app-core-test PRIVATE include include/sdk) target_include_directories(app-core-test PRIVATE include include/sdk logging preferences)
target_link_libraries(app-core-test PRIVATE Qt6::Core Qt6::Network ZLIB::ZLIB) target_link_libraries(app-core-test PRIVATE Qt6::Core Qt6::Network ZLIB::ZLIB)
target_compile_definitions(app-core-test PRIVATE target_compile_definitions(app-core-test PRIVATE
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}") FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}")
@@ -220,9 +221,9 @@ add_test(NAME app-core-test COMMAND app-core-test)
# settings file. The static policy (what a block lasts, when it is in force, what # settings file. The static policy (what a block lasts, when it is in force, what
# a cap or a directory is worth) is pure and needs no clock. # a cap or a directory is worth) is pure and needs no clock.
add_executable(app-settings-test tests/app-settings.test.cpp add_executable(app-settings-test tests/app-settings.test.cpp
src/app-settings.cpp src/log-manager.cpp include/app-settings.h preferences/app-settings.cpp logging/log-manager.cpp preferences/app-settings.h
include/log-manager.h) logging/log-manager.h)
target_include_directories(app-settings-test PRIVATE include include/sdk) target_include_directories(app-settings-test PRIVATE include include/sdk logging preferences)
target_link_libraries(app-settings-test PRIVATE Qt6::Core) target_link_libraries(app-settings-test PRIVATE Qt6::Core)
add_test(NAME app-settings-test COMMAND app-settings-test) add_test(NAME app-settings-test COMMAND app-settings-test)
@@ -231,10 +232,10 @@ add_test(NAME app-settings-test COMMAND app-settings-test)
# JSON catalogue read at runtime really translates. The last test walks the # JSON catalogue read at runtime really translates. The last test walks the
# sources and checks translations/en.json covers every string they ask for. # sources and checks translations/en.json covers every string they ask for.
add_executable(language-manager-test tests/language-manager.test.cpp add_executable(language-manager-test tests/language-manager.test.cpp
src/language-manager.cpp src/app-settings.cpp preferences/language-manager.cpp preferences/app-settings.cpp
include/language-manager.h include/app-settings.h preferences/language-manager.h preferences/app-settings.h
resources/resources.qrc) resources/resources.qrc)
target_include_directories(language-manager-test PRIVATE include include/sdk) target_include_directories(language-manager-test PRIVATE include include/sdk logging preferences)
target_link_libraries(language-manager-test PRIVATE Qt6::Core) target_link_libraries(language-manager-test PRIVATE Qt6::Core)
# The resources come along so the test reads the catalogue exactly where the # The resources come along so the test reads the catalogue exactly where the
# application does, compiled in, rather than a copy that could drift. # application does, compiled in, rather than a copy that could drift.
@@ -246,7 +247,7 @@ add_test(NAME language-manager-test COMMAND language-manager-test)
# #
# The language setting loads a catalogue named <code>.json out of a # The language setting loads a catalogue named <code>.json out of a
# "translations" folder, looked up at runtime next to the settings or next to # "translations" folder, looked up at runtime next to the settings or next to
# the binary (see src/language-manager.cpp). A catalogue is read as it is, so # the binary (see preferences/language-manager.cpp). A catalogue is read as it is, so
# a new language is one text file and no build step: the copy below is a plain # a new language is one text file and no build step: the copy below is a plain
# file copy and never fails the build. # file copy and never fails the build.
# #
@@ -279,8 +280,8 @@ if(Qt6LinguistTools_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/translations)
endif() endif()
add_executable(update-manager-test tests/update-manager.test.cpp add_executable(update-manager-test tests/update-manager.test.cpp
src/update-manager.cpp src/app-logging.cpp include/update-manager.h) src/update-manager.cpp logging/app-logging.cpp include/update-manager.h)
target_include_directories(update-manager-test PRIVATE include include/sdk) target_include_directories(update-manager-test PRIVATE include include/sdk logging preferences)
target_link_libraries(update-manager-test PRIVATE Qt6::Core Qt6::Network) target_link_libraries(update-manager-test PRIVATE Qt6::Core Qt6::Network)
target_compile_definitions(update-manager-test PRIVATE target_compile_definitions(update-manager-test PRIVATE
FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}") FWSPACMANAGE_VERSION="${PACMANAGER_VERSION}")
@@ -315,7 +316,7 @@ if(FWS_BUILD_FLATPAK_PLUGIN)
add_library(flatpak-provider-plugin MODULE add_library(flatpak-provider-plugin MODULE
plugins/flatpak-provider/flatpak-provider.cpp plugins/flatpak-provider/flatpak-provider.cpp
plugins/flatpak-provider/flatpak-manager.cpp) plugins/flatpak-provider/flatpak-manager.cpp)
target_include_directories(flatpak-provider-plugin PRIVATE include include/sdk plugins/flatpak-provider) target_include_directories(flatpak-provider-plugin PRIVATE include include/sdk logging preferences plugins/flatpak-provider)
set_target_properties(flatpak-provider-plugin PROPERTIES set_target_properties(flatpak-provider-plugin PROPERTIES
OUTPUT_NAME "flatpak-provider" OUTPUT_NAME "flatpak-provider"
CXX_STANDARD 17 CXX_STANDARD 17
@@ -330,7 +331,7 @@ if(FWS_BUILD_AUR_PLUGIN)
add_library(aur-provider-plugin MODULE add_library(aur-provider-plugin MODULE
plugins/aur-provider/aur-provider.cpp plugins/aur-provider/aur-provider.cpp
plugins/aur-provider/aur-manager.cpp) plugins/aur-provider/aur-manager.cpp)
target_include_directories(aur-provider-plugin PRIVATE include include/sdk plugins/aur-provider) target_include_directories(aur-provider-plugin PRIVATE include include/sdk logging preferences plugins/aur-provider)
set_target_properties(aur-provider-plugin PROPERTIES set_target_properties(aur-provider-plugin PROPERTIES
OUTPUT_NAME "aur-provider" OUTPUT_NAME "aur-provider"
CXX_STANDARD 17 CXX_STANDARD 17
@@ -343,7 +344,7 @@ endif()
if(FWS_BUILD_EXAMPLE_PLUGIN) if(FWS_BUILD_EXAMPLE_PLUGIN)
add_library(example-provider-plugin MODULE plugins/example-provider/example-provider.cpp) add_library(example-provider-plugin MODULE plugins/example-provider/example-provider.cpp)
target_include_directories(example-provider-plugin PRIVATE include include/sdk) target_include_directories(example-provider-plugin PRIVATE include include/sdk logging preferences)
set_target_properties(example-provider-plugin PROPERTIES set_target_properties(example-provider-plugin PROPERTIES
OUTPUT_NAME "sample-provider" OUTPUT_NAME "sample-provider"
CXX_STANDARD 17 CXX_STANDARD 17
@@ -356,7 +357,7 @@ endif()
if(FWS_BUILD_EXAMPLE_ADDON) if(FWS_BUILD_EXAMPLE_ADDON)
add_library(example-addon-plugin MODULE plugins/example-addon/example-addon.cpp) add_library(example-addon-plugin MODULE plugins/example-addon/example-addon.cpp)
target_include_directories(example-addon-plugin PRIVATE include include/sdk) target_include_directories(example-addon-plugin PRIVATE include include/sdk logging preferences)
# The demo addon attaches Qt widgets, so it links the widget module like # The demo addon attaches Qt widgets, so it links the widget module like
# the host application. # the host application.
target_link_libraries(example-addon-plugin PRIVATE Qt6::Widgets) target_link_libraries(example-addon-plugin PRIVATE Qt6::Widgets)
@@ -375,9 +376,9 @@ endif()
# options. # options.
if(FWS_BUILD_EXAMPLE_PLUGIN AND FWS_BUILD_EXAMPLE_ADDON) if(FWS_BUILD_EXAMPLE_PLUGIN AND FWS_BUILD_EXAMPLE_ADDON)
add_executable(plugin-manager-test tests/plugin-manager.test.cpp add_executable(plugin-manager-test tests/plugin-manager.test.cpp
src/plugin-manager.cpp src/pacman-manager.cpp src/app-logging.cpp src/plugin-manager.cpp src/pacman-manager.cpp logging/app-logging.cpp
plugins/flatpak-provider/flatpak-manager.cpp) plugins/flatpak-provider/flatpak-manager.cpp)
target_include_directories(plugin-manager-test PRIVATE include include/sdk plugins/flatpak-provider) target_include_directories(plugin-manager-test PRIVATE include include/sdk logging preferences plugins/flatpak-provider)
# Qt6::Widgets is linked so the process can load the example addon, which # Qt6::Widgets is linked so the process can load the example addon, which
# itself links the widget module. # itself links the widget module.
target_link_libraries(plugin-manager-test PRIVATE Qt6::Core Qt6::Widgets) target_link_libraries(plugin-manager-test PRIVATE Qt6::Core Qt6::Widgets)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.