mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-25 18:49:47 +01:00
minor fixes
This commit is contained in:
parent
838ea2c9aa
commit
3566efa667
3 changed files with 10 additions and 4 deletions
|
@ -1171,8 +1171,11 @@ void* const* CConfigManager::getConfigValuePtr(const std::string& val) {
|
|||
return VAL->getDataStaticPtr();
|
||||
}
|
||||
|
||||
Hyprlang::CConfigValue* CConfigManager::getHyprlangConfigValuePtr(const std::string& val) {
|
||||
return m_pConfig->getConfigValuePtr(val.c_str());
|
||||
Hyprlang::CConfigValue* CConfigManager::getHyprlangConfigValuePtr(const std::string& name, const std::string& specialCat) {
|
||||
if (!specialCat.empty())
|
||||
return m_pConfig->getSpecialConfigValuePtr(specialCat.c_str(), name.c_str(), nullptr);
|
||||
|
||||
return m_pConfig->getConfigValuePtr(name.c_str());
|
||||
}
|
||||
|
||||
bool CConfigManager::deviceConfigExists(const std::string& dev) {
|
||||
|
@ -1378,7 +1381,7 @@ void CConfigManager::removePluginConfig(HANDLE handle) {
|
|||
if (h != handle)
|
||||
continue;
|
||||
|
||||
m_pConfig->removeSpecialConfigValue("plugin:", n.c_str());
|
||||
m_pConfig->removeSpecialConfigValue("plugin", n.c_str());
|
||||
}
|
||||
std::erase_if(pluginVariables, [handle](const auto& other) { return other.handle == handle; });
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class CConfigManager {
|
|||
bool shouldBlurLS(const std::string&);
|
||||
|
||||
void* const* getConfigValuePtr(const std::string&);
|
||||
Hyprlang::CConfigValue* getHyprlangConfigValuePtr(const std::string&);
|
||||
Hyprlang::CConfigValue* getHyprlangConfigValuePtr(const std::string& name, const std::string& specialCat = "");
|
||||
void onPluginLoadUnload(const std::string& name, bool load);
|
||||
static std::string getConfigDir();
|
||||
static std::string getMainConfigPath();
|
||||
|
|
|
@ -182,6 +182,9 @@ APICALL Hyprlang::CConfigValue* HyprlandAPI::getConfigValue(HANDLE handle, const
|
|||
if (!PLUGIN)
|
||||
return nullptr;
|
||||
|
||||
if (name.starts_with("plugin:"))
|
||||
return g_pConfigManager->getHyprlangConfigValuePtr(name.substr(7), "plugin");
|
||||
|
||||
return g_pConfigManager->getHyprlangConfigValuePtr(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue