Clean up config names a bit

This commit is contained in:
Nicolas Werner 2021-02-09 16:26:18 +01:00
parent 23a9306383
commit 50f994bd23
2 changed files with 5 additions and 8 deletions

View file

@ -93,7 +93,7 @@ UserSettings::load(std::optional<QString> profile)
sortByImportance_ = settings.value("user/sort_by_unread", true).toBool(); sortByImportance_ = settings.value("user/sort_by_unread", true).toBool();
readReceipts_ = settings.value("user/read_receipts", true).toBool(); readReceipts_ = settings.value("user/read_receipts", true).toBool();
theme_ = settings.value("user/theme", defaultTheme_).toString(); theme_ = settings.value("user/theme", defaultTheme_).toString();
font_ = settings.value("user/font_family", "").toString(); font_ = settings.value("user/font_family", "default").toString();
avatarCircles_ = settings.value("user/avatar_circles", true).toBool(); avatarCircles_ = settings.value("user/avatar_circles", true).toBool();
decryptSidebar_ = settings.value("user/decrypt_sidebar", true).toBool(); decryptSidebar_ = settings.value("user/decrypt_sidebar", true).toBool();
privacyScreen_ = settings.value("user/privacy_screen", false).toBool(); privacyScreen_ = settings.value("user/privacy_screen", false).toBool();
@ -101,7 +101,7 @@ UserSettings::load(std::optional<QString> profile)
shareKeysWithTrustedUsers_ = shareKeysWithTrustedUsers_ =
settings.value("user/share_keys_with_trusted_users", true).toBool(); settings.value("user/share_keys_with_trusted_users", true).toBool();
mobileMode_ = settings.value("user/mobile_mode", false).toBool(); mobileMode_ = settings.value("user/mobile_mode", false).toBool();
emojiFont_ = settings.value("user/emoji_font_family", "Default").toString(); emojiFont_ = settings.value("user/emoji_font_family", "default").toString();
baseFontSize_ = settings.value("user/font_size", QFont().pointSizeF()).toDouble(); baseFontSize_ = settings.value("user/font_size", QFont().pointSizeF()).toDouble();
auto tempPresence = settings.value("user/presence", "").toString().toStdString(); auto tempPresence = settings.value("user/presence", "").toString().toStdString();
auto presenceValue = QMetaEnum::fromType<Presence>().keyToValue(tempPresence.c_str()); auto presenceValue = QMetaEnum::fromType<Presence>().keyToValue(tempPresence.c_str());
@ -343,7 +343,7 @@ UserSettings::setEmojiFontFamily(QString family)
return; return;
if (family == tr("Default")) { if (family == tr("Default")) {
emojiFont_ = "Default"; emojiFont_ = "default";
} else { } else {
emojiFont_ = family; emojiFont_ = family;
} }
@ -737,10 +737,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
} }
QString currentFont = settings_->font(); QString currentFont = settings_->font();
if (currentFont == "Default") { if (currentFont != "default" || currentFont != "") {
fontSelectionCombo_->setCurrentIndex(
fontSelectionCombo_->findText(tr(currentFont.toStdString().c_str())));
} else {
fontSelectionCombo_->setCurrentIndex(fontSelectionCombo_->findText(currentFont)); fontSelectionCombo_->setCurrentIndex(fontSelectionCombo_->findText(currentFont));
} }

View file

@ -214,7 +214,7 @@ main(int argc, char *argv[])
QFont font; QFont font;
QString userFontFamily = settings.lock()->font(); QString userFontFamily = settings.lock()->font();
if (!userFontFamily.isEmpty()) { if (!userFontFamily.isEmpty() && userFontFamily != "default") {
font.setFamily(userFontFamily); font.setFamily(userFontFamily);
} }
font.setPointSizeF(settings.lock()->fontSize()); font.setPointSizeF(settings.lock()->fontSize());