File indexing completed on 2025-03-16 05:18:23
0001 /* 0002 * Copyright 2019 by Marco Martin <mart@kde.org> 0003 * Copyright 2018 by Aditya Mehra <aix.m@outlook.com> 0004 * 0005 * Licensed under the Apache License, Version 2.0 (the "License"); 0006 * you may not use this file except in compliance with the License. 0007 * You may obtain a copy of the License at 0008 * 0009 * http://www.apache.org/licenses/LICENSE-2.0 0010 * 0011 * Unless required by applicable law or agreed to in writing, software 0012 * distributed under the License is distributed on an "AS IS" BASIS, 0013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0014 * See the License for the specific language governing permissions and 0015 * limitations under the License. 0016 * 0017 */ 0018 0019 #include <QDebug> 0020 #include <QFile> 0021 #include "appsettings.h" 0022 0023 AppSettings::AppSettings(QObject *parent) : 0024 QObject(parent) 0025 { 0026 } 0027 0028 bool AppSettings::darkMode() const 0029 { 0030 return m_settings.value(QStringLiteral("darkMode"), true).toBool(); 0031 } 0032 0033 void AppSettings::setDarkMode(bool dark) 0034 { 0035 if (AppSettings::darkMode() == dark) { 0036 return; 0037 } 0038 0039 m_settings.setValue(QStringLiteral("darkMode"), dark); 0040 emit darkModeChanged(); 0041 } 0042 0043 bool AppSettings::usesRemoteSTT() const 0044 { 0045 return m_settings.value(QStringLiteral("usesRemoteSTT"), false).toBool(); 0046 } 0047 0048 void AppSettings::setUsesRemoteSTT(bool remote) 0049 { 0050 if (AppSettings::usesRemoteSTT() == remote) { 0051 return; 0052 } 0053 0054 m_settings.setValue(QStringLiteral("usesRemoteSTT"), remote); 0055 emit usesRemoteSTTChanged(); 0056 }