Skip to content

Commit

Permalink
ref: reorder user dirs & make template optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Dich0tomy committed Mar 12, 2024
1 parent d105a7b commit f83b7e6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
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

0 comments on commit f83b7e6

Please sign in to comment.