mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibCore+Base: Move user-specific config files to $HOME/.config
This commit is contained in:
parent
7b15c85ff5
commit
bc615572a9
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)
|
NonnullRefPtr<ConfigFile> ConfigFile::get_for_app(const String& app_name)
|
||||||
{
|
{
|
||||||
String home_path = StandardPaths::home_directory();
|
String directory = StandardPaths::config_directory();
|
||||||
auto path = String::format("%s/%s.ini", home_path.characters(), app_name.characters());
|
auto path = String::format("%s/%s.ini", directory.characters(), app_name.characters());
|
||||||
return adopt(*new ConfigFile(path));
|
return adopt(*new ConfigFile(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,14 @@ String StandardPaths::downloads_directory()
|
||||||
return LexicalPath::canonicalized_path(builder.to_string());
|
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()
|
String StandardPaths::tempfile_directory()
|
||||||
{
|
{
|
||||||
return "/tmp";
|
return "/tmp";
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
static String desktop_directory();
|
static String desktop_directory();
|
||||||
static String downloads_directory();
|
static String downloads_directory();
|
||||||
static String tempfile_directory();
|
static String tempfile_directory();
|
||||||
|
static String config_directory();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue