Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: reorder user dirs & make template optional #20

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/include/dire/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ struct BaseDirsBundle
auto bundle() -> Optional<BaseDirsBundle>;

auto home_dir() -> Optional<Path>;

auto cache_dir() -> Optional<Path>;
auto config_dir() -> Optional<Path>;
auto config_local_dir() -> Optional<Path>;
auto data_dir() -> Optional<Path>;
auto data_local_dir() -> Optional<Path>;
auto executable_dir() -> Optional<Path>;
auto preference_dir() -> Optional<Path>;

auto executable_dir() -> Optional<Path>;
auto runtime_dir() -> Optional<Path>;
auto state_dir() -> Optional<Path>;

Expand Down
13 changes: 8 additions & 5 deletions src/lib/include/dire/user.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,31 @@ struct UserDirsBundle
{
Path home_dir;

Optional<Path> 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<Path> font_dir;
Optional<Path> template_dir;
};

auto bundle() -> Optional<UserDirsBundle>;

auto home_dir() -> Optional<Path>;

auto audio_dir() -> Optional<Path>;
auto desktop_dir() -> Optional<Path>;
auto document_dir() -> Optional<Path>;
auto download_dir() -> Optional<Path>;
auto font_dir() -> Optional<Path>;
auto picture_dir() -> Optional<Path>;
auto video_dir() -> Optional<Path>;
auto public_dir() -> Optional<Path>;

auto font_dir() -> Optional<Path>;
auto template_dir() -> Optional<Path>;
auto video_dir() -> Optional<Path>;

} // namespace dire::user
5 changes: 3 additions & 2 deletions src/lib/src/dire/linux/user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ auto bundle() -> Optional<UserDirsBundle>
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),
} };
}

Expand Down
5 changes: 3 additions & 2 deletions src/lib/src/dire/mac/user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ auto bundle() -> Optional<UserDirsBundle>
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),
} };
}

Expand Down
5 changes: 3 additions & 2 deletions src/lib/src/dire/windows/user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ auto bundle() -> Optional<UserDirsBundle>
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(),
} };
}

Expand Down
Loading