mirror of https://github.com/procxx/kepka.git
Fixed saving of not loaded dictionaries.
This commit is contained in:
parent
62e0ced6a6
commit
039ed17683
|
@ -251,7 +251,7 @@ void Inner::setupContent(Dictionaries enabledDictionaries) {
|
||||||
ranges::contains(enabledDictionaries, set.id));
|
ranges::contains(enabledDictionaries, set.id));
|
||||||
row->toggledValue(
|
row->toggledValue(
|
||||||
) | rpl::start_with_next([=](auto enabled) {
|
) | rpl::start_with_next([=](auto enabled) {
|
||||||
if (enabled && DictExists(set.id)) {
|
if (enabled) {
|
||||||
_enabledRows.push_back(set.id);
|
_enabledRows.push_back(set.id);
|
||||||
} else {
|
} else {
|
||||||
auto &rows = _enabledRows;
|
auto &rows = _enabledRows;
|
||||||
|
@ -280,7 +280,11 @@ void ManageDictionariesBox::prepare() {
|
||||||
setTitle(tr::lng_settings_manage_dictionaries());
|
setTitle(tr::lng_settings_manage_dictionaries());
|
||||||
|
|
||||||
addButton(tr::lng_settings_save(), [=] {
|
addButton(tr::lng_settings_save(), [=] {
|
||||||
_session->settings().setDictionariesEnabled(inner->enabledRows());
|
auto enabledRows = inner->enabledRows();
|
||||||
|
_session->settings().setDictionariesEnabled(
|
||||||
|
enabledRows | ranges::views::filter(
|
||||||
|
DictExists
|
||||||
|
) | ranges::to_vector);
|
||||||
_session->saveSettingsDelayed();
|
_session->saveSettingsDelayed();
|
||||||
closeBox();
|
closeBox();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue