From 50f994bd235f4f551ebdbef6df0d83209ea2042b Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 9 Feb 2021 16:26:18 +0100 Subject: [PATCH] Clean up config names a bit --- src/UserSettingsPage.cpp | 11 ++++------- src/main.cpp | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index 820669a6..b6fdf504 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -93,7 +93,7 @@ UserSettings::load(std::optional profile) sortByImportance_ = settings.value("user/sort_by_unread", true).toBool(); readReceipts_ = settings.value("user/read_receipts", true).toBool(); 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(); decryptSidebar_ = settings.value("user/decrypt_sidebar", true).toBool(); privacyScreen_ = settings.value("user/privacy_screen", false).toBool(); @@ -101,7 +101,7 @@ UserSettings::load(std::optional profile) shareKeysWithTrustedUsers_ = settings.value("user/share_keys_with_trusted_users", true).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(); auto tempPresence = settings.value("user/presence", "").toString().toStdString(); auto presenceValue = QMetaEnum::fromType().keyToValue(tempPresence.c_str()); @@ -343,7 +343,7 @@ UserSettings::setEmojiFontFamily(QString family) return; if (family == tr("Default")) { - emojiFont_ = "Default"; + emojiFont_ = "default"; } else { emojiFont_ = family; } @@ -737,10 +737,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer settings, QWidge } QString currentFont = settings_->font(); - if (currentFont == "Default") { - fontSelectionCombo_->setCurrentIndex( - fontSelectionCombo_->findText(tr(currentFont.toStdString().c_str()))); - } else { + if (currentFont != "default" || currentFont != "") { fontSelectionCombo_->setCurrentIndex(fontSelectionCombo_->findText(currentFont)); } diff --git a/src/main.cpp b/src/main.cpp index 07962b9b..0c7c9f60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -214,7 +214,7 @@ main(int argc, char *argv[]) QFont font; QString userFontFamily = settings.lock()->font(); - if (!userFontFamily.isEmpty()) { + if (!userFontFamily.isEmpty() && userFontFamily != "default") { font.setFamily(userFontFamily); } font.setPointSizeF(settings.lock()->fontSize());