API: make addSpecialConfigValue take a ref to val

woo breaking API and ABI
This commit is contained in:
Vaxry 2024-02-13 16:26:06 +00:00
parent a3b1a6b649
commit ebffe8f61d
2 changed files with 5 additions and 3 deletions

View file

@ -299,11 +299,13 @@ namespace Hyprlang {
void removeSpecialCategory(const char* name); void removeSpecialCategory(const char* name);
/*! /*!
\since 0.3.0 \since 0.3.2
Add a config value to a special category. Add a config value to a special category.
\note Before 0.3.2, this takes a `const CConfigValue` (non-ref)
*/ */
void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value); void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value);
/*! /*!
Remove a config value from a special category. Remove a config value from a special category.

View file

@ -70,7 +70,7 @@ void CConfig::addConfigValue(const char* name, const CConfigValue& value) {
reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->dtor}); reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->dtor});
} }
void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value) { void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value) {
const auto IT = std::find_if(impl->specialCategoryDescriptors.begin(), impl->specialCategoryDescriptors.end(), [&](const auto& other) { return other->name == cat; }); const auto IT = std::find_if(impl->specialCategoryDescriptors.begin(), impl->specialCategoryDescriptors.end(), [&](const auto& other) { return other->name == cat; });
if (IT == impl->specialCategoryDescriptors.end()) if (IT == impl->specialCategoryDescriptors.end())