Support icons in ~/.local/share/icons
This commit is contained in:
@@ -241,7 +241,6 @@ std::unordered_map<std::string, application> list_applications()
|
||||
});
|
||||
}
|
||||
}
|
||||
do_data_dir(xdg_data_home(), res);
|
||||
|
||||
for (auto && dir: xdg_data_dirs())
|
||||
do_data_dir(std::move(dir), res);
|
||||
|
||||
@@ -45,7 +45,7 @@ std::filesystem::path xdg_cache_home()
|
||||
|
||||
std::filesystem::path xdg_data_home()
|
||||
{
|
||||
if (const char * xdg_data_home = std::getenv("XDG_DATA_HOME"))
|
||||
if (const char * xdg_data_home = std::getenv("XDG_DATA_HOME"); xdg_data_home and *xdg_data_home)
|
||||
return xdg_data_home;
|
||||
|
||||
if (const char * home = std::getenv("HOME"))
|
||||
@@ -71,9 +71,11 @@ std::vector<std::filesystem::path> xdg_config_dirs()
|
||||
return paths;
|
||||
}
|
||||
|
||||
std::vector<std::filesystem::path> xdg_data_dirs()
|
||||
std::vector<std::filesystem::path> xdg_data_dirs(bool include_data_home)
|
||||
{
|
||||
std::vector<std::filesystem::path> paths;
|
||||
if (include_data_home)
|
||||
paths.push_back(xdg_data_home());
|
||||
|
||||
if (const char * xdg_config_dirs = std::getenv("XDG_DATA_DIRS"))
|
||||
{
|
||||
|
||||
@@ -26,4 +26,4 @@ std::filesystem::path xdg_config_home();
|
||||
std::filesystem::path xdg_cache_home();
|
||||
std::filesystem::path xdg_data_home();
|
||||
std::vector<std::filesystem::path> xdg_config_dirs();
|
||||
std::vector<std::filesystem::path> xdg_data_dirs();
|
||||
std::vector<std::filesystem::path> xdg_data_dirs(bool include_data_home = true);
|
||||
|
||||
Reference in New Issue
Block a user