Support icons in ~/.local/share/icons

This commit is contained in:
Patrick Nicolas
2026-02-16 20:32:34 +01:00
parent 219146e763
commit 9353646b55
3 changed files with 5 additions and 4 deletions
-1
View File
@@ -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);
+4 -2
View File
@@ -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"))
{
+1 -1
View File
@@ -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);