LibCore+Base: Move user-specific config files to $HOME/.config
This commit is contained in:
parent
7b15c85ff5
commit
bc615572a9
Notes:
sideshowbarker
2024-07-19 04:15:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/bc615572a97
9 changed files with 11 additions and 2 deletions
|
@ -36,8 +36,8 @@ namespace Core {
|
|||
|
||||
NonnullRefPtr<ConfigFile> ConfigFile::get_for_app(const String& app_name)
|
||||
{
|
||||
String home_path = StandardPaths::home_directory();
|
||||
auto path = String::format("%s/%s.ini", home_path.characters(), app_name.characters());
|
||||
String directory = StandardPaths::config_directory();
|
||||
auto path = String::format("%s/%s.ini", directory.characters(), app_name.characters());
|
||||
return adopt(*new ConfigFile(path));
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,14 @@ String StandardPaths::downloads_directory()
|
|||
return LexicalPath::canonicalized_path(builder.to_string());
|
||||
}
|
||||
|
||||
String StandardPaths::config_directory()
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append(home_directory());
|
||||
builder.append("/.config");
|
||||
return LexicalPath::canonicalized_path(builder.to_string());
|
||||
}
|
||||
|
||||
String StandardPaths::tempfile_directory()
|
||||
{
|
||||
return "/tmp";
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
static String desktop_directory();
|
||||
static String downloads_directory();
|
||||
static String tempfile_directory();
|
||||
static String config_directory();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue