From 339dc4f806b0c39a4ec6460187f345c4e2890d05 Mon Sep 17 00:00:00 2001
From: lat9nq <22451773+lat9nq@users.noreply.github.com>
Date: Sun, 16 May 2021 01:17:18 -0400
Subject: general: Demote custom_rtc to regular setting

---
 src/yuzu/configuration/config.cpp | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

(limited to 'src/yuzu/configuration/config.cpp')

diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index c6135919fa..125feb86bf 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -868,17 +868,14 @@ void Config::ReadSystemValues() {
         }
     }
 
-    bool custom_rtc_enabled;
-    ReadSettingGlobal(custom_rtc_enabled, QStringLiteral("custom_rtc_enabled"), false);
-    bool custom_rtc_global =
-        global || qt_config->value(QStringLiteral("custom_rtc/use_global"), true).toBool();
-    Settings::values.custom_rtc.SetGlobal(custom_rtc_global);
-    if (global || !custom_rtc_global) {
+    if (global) {
+        const auto custom_rtc_enabled =
+            ReadSetting(QStringLiteral("custom_rtc_enabled"), false).toBool();
         if (custom_rtc_enabled) {
-            Settings::values.custom_rtc.SetValue(
-                std::chrono::seconds(ReadSetting(QStringLiteral("custom_rtc"), 0).toULongLong()));
+            Settings::values.custom_rtc =
+                std::chrono::seconds(ReadSetting(QStringLiteral("custom_rtc"), 0).toULongLong());
         } else {
-            Settings::values.custom_rtc.SetValue(std::nullopt);
+            Settings::values.custom_rtc = std::nullopt;
         }
     }
 
@@ -1433,14 +1430,14 @@ void Config::SaveSystemValues() {
                        Settings::values.rng_seed.GetValue(global).value_or(0),
                        Settings::values.rng_seed.UsingGlobal(), 0);
 
-    WriteSettingGlobal(QStringLiteral("custom_rtc_enabled"),
-                       Settings::values.custom_rtc.GetValue(global).has_value(),
-                       Settings::values.custom_rtc.UsingGlobal(), false);
-    WriteSettingGlobal(
-        QStringLiteral("custom_rtc"),
-        QVariant::fromValue<long long>(
-            Settings::values.custom_rtc.GetValue(global).value_or(std::chrono::seconds{}).count()),
-        Settings::values.custom_rtc.UsingGlobal(), 0);
+    if (global) {
+        WriteSetting(QStringLiteral("custom_rtc_enabled"), Settings::values.custom_rtc.has_value(),
+                     false);
+        WriteSetting(QStringLiteral("custom_rtc"),
+                     QVariant::fromValue<long long>(
+                         Settings::values.custom_rtc.value_or(std::chrono::seconds{}).count()),
+                     0);
+    }
 
     WriteSettingGlobal(QStringLiteral("sound_index"), Settings::values.sound_index, 1);
 
-- 
cgit v1.2.3-70-g09d2