From a15e3e1f380e3b90f976bc7d1d8b4daabd4cbd3b Mon Sep 17 00:00:00 2001 From: Philip Damianik <39028343+pdamianik@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:14:18 +0200 Subject: config/input: Improve fallback behavior for unset device config values (#3184) * Fix fallback behavior for unset device config values * Replace overload with default argument for fallback config key * Remove default value for fallback argument in source * Fix typos --- src/config/ConfigManager.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/config/ConfigManager.hpp') diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index a14f5470..8586ec89 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -156,9 +156,9 @@ class CConfigManager { void setInt(const std::string&, int); void setString(const std::string&, const std::string&); - int getDeviceInt(const std::string&, const std::string&, std::optional touchpad = {}); - float getDeviceFloat(const std::string&, const std::string&, std::optional touchpad = {}); - std::string getDeviceString(const std::string&, const std::string&, std::optional touchpad = {}); + int getDeviceInt(const std::string&, const std::string&, const std::string& fallback = ""); + float getDeviceFloat(const std::string&, const std::string&, const std::string& fallback = ""); + std::string getDeviceString(const std::string&, const std::string&, const std::string& fallback = ""); bool deviceConfigExists(const std::string&); bool shouldBlurLS(const std::string&); @@ -255,7 +255,7 @@ class CConfigManager { void applyUserDefinedVars(std::string&, const size_t); void loadConfigLoadVars(); SConfigValue getConfigValueSafe(const std::string&); - SConfigValue getConfigValueSafeDevice(const std::string&, const std::string&, std::optional touchpad); + SConfigValue getConfigValueSafeDevice(const std::string&, const std::string&, const std::string& fallback = ""); void parseLine(std::string&); void configSetValueSafe(const std::string&, const std::string&); void handleDeviceConfig(const std::string&, const std::string&); -- cgit v1.2.3