Skip to content

Commit 826f9c9

Browse files
committed
config: fix wallpaper:recursive does not exist
1 parent 0ca403a commit 826f9c9

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/config/ConfigManager.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ std::vector<CConfigManager::SSetting> CConfigManager::getSettings() {
174174

175175
for (auto& key : keys) {
176176
std::string monitor, fitMode, path, order;
177-
int timeout, recursive;
177+
int timeout;
178+
bool recursive;
178179

179180
try {
180181
monitor = std::any_cast<Hyprlang::STRING>(m_config.getSpecialConfigValue("wallpaper", "monitor", key.c_str()));
@@ -188,7 +189,7 @@ std::vector<CConfigManager::SSetting> CConfigManager::getSettings() {
188189
continue;
189190
}
190191

191-
const auto RESOLVE_PATH = getFullPath(path, recursive != 0);
192+
const auto RESOLVE_PATH = getFullPath(path, recursive);
192193

193194
if (!RESOLVE_PATH) {
194195
g_logger->log(LOG_ERR, "Failed to resolve path {}: {}", path, RESOLVE_PATH.error());
@@ -215,7 +216,14 @@ std::vector<CConfigManager::SSetting> CConfigManager::getSettings() {
215216
}
216217
}
217218

218-
result.emplace_back(SSetting{.monitor = std::move(monitor), .fitMode = std::move(fitMode), .paths = std::move(resolvedPaths), .order = std::move(order), .timeout = timeout});
219+
result.emplace_back(SSetting{
220+
.monitor = std::move(monitor),
221+
.fitMode = std::move(fitMode),
222+
.paths = std::move(resolvedPaths),
223+
.order = std::move(order),
224+
.timeout = timeout,
225+
.recursive = recursive,
226+
});
219227
}
220228

221229
return result;

src/config/ConfigManager.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ class CConfigManager {
1616
struct SSetting {
1717
std::string monitor, fitMode;
1818
std::vector<std::string> paths;
19-
std::string order = "default";
20-
int timeout = 0;
21-
uint32_t id = 0;
19+
std::string order = "default";
20+
int timeout = 0;
21+
uint32_t id = 0;
22+
bool recursive = false;
2223
};
2324

2425
constexpr static const uint32_t SETTING_INVALID = 0;

0 commit comments

Comments
 (0)