From f83b7e658615a17742bdb80a5b7a3c756c26fb48 Mon Sep 17 00:00:00 2001 From: b4mbus Date: Tue, 12 Mar 2024 22:04:35 +0100 Subject: [PATCH] ref: reorder user dirs & make template optional --- src/lib/include/dire/base.hpp | 4 +++- src/lib/include/dire/user.hpp | 13 ++++++++----- src/lib/src/dire/linux/user.cpp | 5 +++-- src/lib/src/dire/mac/user.cpp | 5 +++-- src/lib/src/dire/windows/user.cpp | 5 +++-- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/lib/include/dire/base.hpp b/src/lib/include/dire/base.hpp index 170eb2e..d2d20df 100644 --- a/src/lib/include/dire/base.hpp +++ b/src/lib/include/dire/base.hpp @@ -23,13 +23,15 @@ struct BaseDirsBundle auto bundle() -> Optional; auto home_dir() -> Optional; + auto cache_dir() -> Optional; auto config_dir() -> Optional; auto config_local_dir() -> Optional; auto data_dir() -> Optional; auto data_local_dir() -> Optional; -auto executable_dir() -> Optional; auto preference_dir() -> Optional; + +auto executable_dir() -> Optional; auto runtime_dir() -> Optional; auto state_dir() -> Optional; diff --git a/src/lib/include/dire/user.hpp b/src/lib/include/dire/user.hpp index 542ee51..9eddb3d 100644 --- a/src/lib/include/dire/user.hpp +++ b/src/lib/include/dire/user.hpp @@ -9,28 +9,31 @@ struct UserDirsBundle { Path home_dir; - Optional font_dir; Path audio_dir; Path desktop_dir; Path document_dir; Path download_dir; Path picture_dir; - Path public_dir; - Path template_dir; Path video_dir; + Path public_dir; + + Optional font_dir; + Optional template_dir; }; auto bundle() -> Optional; auto home_dir() -> Optional; + auto audio_dir() -> Optional; auto desktop_dir() -> Optional; auto document_dir() -> Optional; auto download_dir() -> Optional; -auto font_dir() -> Optional; auto picture_dir() -> Optional; +auto video_dir() -> Optional; auto public_dir() -> Optional; + +auto font_dir() -> Optional; auto template_dir() -> Optional; -auto video_dir() -> Optional; } // namespace dire::user diff --git a/src/lib/src/dire/linux/user.cpp b/src/lib/src/dire/linux/user.cpp index 0d66dd1..1da50cb 100644 --- a/src/lib/src/dire/linux/user.cpp +++ b/src/lib/src/dire/linux/user.cpp @@ -67,15 +67,16 @@ auto bundle() -> Optional return { { .home_dir = *home, - .font_dir = ::font_dir_from_home(*home), .audio_dir = ::audio_dir_from_home(*home), .desktop_dir = ::desktop_dir_from_home(*home), .document_dir = ::document_dir_from_home(*home), .download_dir = ::download_dir_from_home(*home), .picture_dir = ::picture_dir_from_home(*home), + .video_dir = ::video_dir_from_home(*home), .public_dir = ::public_dir_from_home(*home), + + .font_dir = ::font_dir_from_home(*home), .template_dir = ::template_dir_from_home(*home), - .video_dir = ::video_dir_from_home(*home), } }; } diff --git a/src/lib/src/dire/mac/user.cpp b/src/lib/src/dire/mac/user.cpp index 2254bd7..dd04e0a 100644 --- a/src/lib/src/dire/mac/user.cpp +++ b/src/lib/src/dire/mac/user.cpp @@ -62,15 +62,16 @@ auto bundle() -> Optional return { { .home_dir = *home, - .font_dir = concat_font_dir(*home), .audio_dir = concat_audio_dir(*home), .desktop_dir = concat_desktop_dir(*home), .document_dir = concat_document_dir(*home), .download_dir = concat_download_dir(*home), .picture_dir = concat_picture_dir(*home), + .video_dir = concat_video_dir(*home), .public_dir = concat_public_dir(*home), + + .font_dir = concat_font_dir(*home), .template_dir = {}, - .video_dir = concat_video_dir(*home), } }; } diff --git a/src/lib/src/dire/windows/user.cpp b/src/lib/src/dire/windows/user.cpp index 494b298..caaa466 100644 --- a/src/lib/src/dire/windows/user.cpp +++ b/src/lib/src/dire/windows/user.cpp @@ -16,15 +16,16 @@ auto bundle() -> Optional return { { .home_dir = *home, - .font_dir = {}, .audio_dir = *audio_dir(), .desktop_dir = *desktop_dir(), .document_dir = *document_dir(), .download_dir = *download_dir(), .picture_dir = *picture_dir(), + .video_dir = *video_dir(), .public_dir = *public_dir(), + + .font_dir = {}, .template_dir = *template_dir(), - .video_dir = *video_dir(), } }; }