Skip to content

Commit

Permalink
🟠 preferences: fix: theme saving was not correct (#91)
Browse files Browse the repository at this point in the history
Fix theme saving
  • Loading branch information
Sclafus authored Dec 11, 2023
2 parents 8b59ae9 + ed62b20 commit f5f6b32
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/preferences/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ void Preferences::loadTwitchSettings()
ui->twitchChannelLineEdit->setText(settings.value("twitch/channel").toString());
}


void Preferences::loadOsuApiSettings()
{
ui->osuapiClientIdLineEdit->setText(settings.value("osuapi/clientId").toString());
ui->osuapiClientSecretLineEdit->setText(settings.value("osuapi/clientSecret").toString());
}


void Preferences::loadGosuMemorySettings()
{
ui->gosumemoryIpLineEdit->setText(settings.value("gosumemory/ip").toString());
Expand All @@ -91,8 +93,8 @@ void Preferences::loadThemeSettings()
}
else {
bool isDarkMode = darkModeSetting.toBool();
ui->themesLightRadio->setChecked(!isDarkMode);
ui->themesDarkRadio->setChecked(isDarkMode);
QRadioButton *button = isDarkMode ? ui->themesDarkRadio : ui->themesLightRadio;
button->setChecked(true);
}
}

Expand Down Expand Up @@ -125,7 +127,7 @@ void Preferences::saveSettings()
settings.setValue("osuirc/server", ui->osuIrcServerLineEdit->text());
settings.setValue("osuirc/port", ui->osuIrcPortLineEdit->text());

if (ui->themesDefaultRadio->isChecked() && settings.contains("theme/darkMode")) {
if (ui->themesDefaultRadio->isChecked()) {
settings.remove("theme/darkMode");
}
else {
Expand Down

0 comments on commit f5f6b32

Please sign in to comment.