summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-02-09 16:26:18 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-02-09 16:26:38 +0100
commit50f994bd235f4f551ebdbef6df0d83209ea2042b (patch)
treed523cf1b3ae247c29a6411a72340100f76f2ec00
parentMerge pull request #459 from Jedi18/minor_fixes (diff)
downloadnheko-50f994bd235f4f551ebdbef6df0d83209ea2042b.tar.xz
Clean up config names a bit
-rw-r--r--src/UserSettingsPage.cpp11
-rw-r--r--src/main.cpp2
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<QString> 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<QString> 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<Presence>().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<UserSettings> 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());