mirror of
https://github.com/august-alt/gpui.git
synced 2025-03-14 12:58:39 +03:00
fix: the prefix was ignored in loadListFromRegistry
This commit is contained in:
parent
4e49199a00
commit
b4fb27d070
@ -111,14 +111,18 @@ QMap<std::string, QString> loadListFromRegistry(AbstractRegistrySource &source,
|
||||
{
|
||||
QMap<std::string, QString> items;
|
||||
std::vector<std::string> valueNames = source.getValueNames(key);
|
||||
|
||||
// finding and erase **delvals.
|
||||
valueNames.erase(std::remove_if(valueNames.begin(), valueNames.end(),
|
||||
[](const std::string& name) {
|
||||
return QString::fromStdString(name).compare("**delvals.", Qt::CaseInsensitive) == 0;
|
||||
}),
|
||||
valueNames.end());
|
||||
|
||||
|
||||
if(!prefix.empty())
|
||||
{
|
||||
// remove all valueNames(from return result), that doesn't have `prefix` prefix
|
||||
valueNames.erase(std::remove_if(valueNames.begin(), valueNames.end(),
|
||||
[&prefix](const std::string& str)
|
||||
{
|
||||
return !(str.length() > prefix.length() &&
|
||||
strncmp(str.c_str(), prefix.c_str(), prefix.length()));
|
||||
}), valueNames.end());
|
||||
}
|
||||
|
||||
for (auto &valueName : valueNames) {
|
||||
items[valueName] =
|
||||
source.getValue(key, valueName).value<QString>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user