mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-05 16:45:42 -04:00
Qt: Remove setting when string value is empty
This commit is contained in:
parent
148a706771
commit
c7beac5efd
@ -279,7 +279,11 @@ void BindWidgetToStringSetting(QtHostInterface* hi, WidgetType* widget, std::str
|
|||||||
|
|
||||||
Accessor::connectValueChanged(widget, [hi, widget, section, key]() {
|
Accessor::connectValueChanged(widget, [hi, widget, section, key]() {
|
||||||
const QString new_value = Accessor::getStringValue(widget);
|
const QString new_value = Accessor::getStringValue(widget);
|
||||||
hi->SetStringSettingValue(section.c_str(), key.c_str(), new_value.toUtf8().constData());
|
if (!new_value.isEmpty())
|
||||||
|
hi->SetStringSettingValue(section.c_str(), key.c_str(), new_value.toUtf8().constData());
|
||||||
|
else
|
||||||
|
hi->RemoveSettingValue(section.c_str(), key.c_str());
|
||||||
|
|
||||||
hi->applySettings();
|
hi->applySettings();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user