From af4ce3953d0810feb9f2433feccf3c1e946b082a Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 8 Apr 2024 18:20:04 +0100 Subject: [PATCH] lib: minor manifest reading fixes fixes #29 --- libhyprcursor/hyprcursor.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libhyprcursor/hyprcursor.cpp b/libhyprcursor/hyprcursor.cpp index 23f805f..8166afd 100644 --- a/libhyprcursor/hyprcursor.cpp +++ b/libhyprcursor/hyprcursor.cpp @@ -141,12 +141,11 @@ static std::string getFullPathForThemeName(const std::string& name, PHYPRCURSORL continue; } - if (!std::filesystem::exists(MANIFESTPATH)) - continue; - CManifest manifest{MANIFESTPATH}; - if (!manifest.parse().has_value()) + if (const auto R = manifest.parse(); R.has_value()) { + Debug::log(HC_LOG_ERR, logfn, "failed parsing Manifest of {}: {}", themeDir.path().string(), *R); continue; + } const std::string NAME = manifest.parsedData.name; @@ -177,12 +176,11 @@ static std::string getFullPathForThemeName(const std::string& name, PHYPRCURSORL const auto MANIFESTPATH = themeDir.path().string() + "/manifest"; - if (std::filesystem::exists(MANIFESTPATH + ".hl") || std::filesystem::exists(MANIFESTPATH + ".toml")) - continue; - - CManifest manifest{MANIFESTPATH}; - if (!manifest.parse().has_value()) + CManifest manifest{MANIFESTPATH}; + if (const auto R = manifest.parse(); R.has_value()) { + Debug::log(HC_LOG_ERR, logfn, "failed parsing Manifest of {}: {}", themeDir.path().string(), *R); continue; + } const std::string NAME = manifest.parsedData.name;