Fix share keys setting not working

This commit is contained in:
Nicolas Werner 2020-10-23 16:59:18 +02:00
parent e537ece88d
commit 1ab20e0ee3

View file

@ -299,6 +299,7 @@ UserSettings::setShareKeysWithTrustedUsers(bool shareKeys)
{
if (shareKeys == shareKeysWithTrustedUsers_)
return;
shareKeysWithTrustedUsers_ = shareKeys;
emit shareKeysWithTrustedUsersChanged(shareKeys);
save();
@ -736,6 +737,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
emit decryptSidebarChanged();
});
connect(shareKeysWithTrustedUsers_, &Toggle::toggled, this, [this](bool disabled) {
settings_->setShareKeysWithTrustedUsers(!disabled);
});
connect(avatarCircles_, &Toggle::toggled, this, [this](bool disabled) {
settings_->setAvatarCircles(!disabled);
});
@ -810,6 +815,7 @@ UserSettingsPage::showEvent(QShowEvent *)
startInTrayToggle_->setState(!settings_->startInTray());
groupViewToggle_->setState(!settings_->groupView());
decryptSidebar_->setState(!settings_->decryptSidebar());
shareKeysWithTrustedUsers_->setState(!settings_->shareKeysWithTrustedUsers());
avatarCircles_->setState(!settings_->avatarCircles());
typingNotifications_->setState(!settings_->typingNotifications());
sortByImportance_->setState(!settings_->sortByImportance());