56 lines
2.1 KiB
C++
56 lines
2.1 KiB
C++
/*
|
|
Speed Climbing Stopwatch - Simple Stopwatch for Climbers
|
|
Copyright (C) 2018 Itsblue Development - Dorian Zeder
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published
|
|
by the Free Software Foundation, version 3 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include "headers/scstwappsettings.h"
|
|
|
|
ScStwAppSettings * pGlobalAppSettings = nullptr;
|
|
|
|
ScStwAppSettings::ScStwAppSettings(ScStwClient * client, QObject* parent)
|
|
:ScStwRemoteSettings(client, parent)
|
|
{
|
|
}
|
|
|
|
QVariant ScStwAppSettings::readSetting(AppInternalSetting key) {
|
|
return ScStwSettings::readSetting(QMetaEnum::fromType<AppInternalSetting>().valueToKey(int(key)), int(key), 1);
|
|
}
|
|
|
|
QVariant ScStwAppSettings::readSetting(int key, int keyLevel) {
|
|
if(keyLevel == ScStwAppSettings::KeyLevel)
|
|
return this->readSetting(ScStwAppSettings::AppInternalSetting(key));
|
|
else
|
|
return ScStwSettings::readSetting(key, keyLevel);
|
|
}
|
|
|
|
bool ScStwAppSettings::writeSetting(AppInternalSetting key, QVariant value) {
|
|
return ScStwSettings::writeSetting(QMetaEnum::fromType<AppInternalSetting>().valueToKey(int(key)), value, int(key), 1);
|
|
}
|
|
|
|
bool ScStwAppSettings::writeSetting(int key, QVariant value, int keyLevel) {
|
|
if(keyLevel == ScStwAppSettings::KeyLevel)
|
|
return this->writeSetting(ScStwAppSettings::AppInternalSetting(key), value);
|
|
else
|
|
return ScStwSettings::writeSetting(key, value, keyLevel);
|
|
}
|
|
|
|
void ScStwAppSettings::setDefaultSetting(AppInternalSetting key, QVariant defaultVariant) {
|
|
ScStwSettings::setDefaultSetting(QMetaEnum::fromType<AppInternalSetting>().valueToKey(int(key)), defaultVariant, int(key), 1);
|
|
}
|
|
|
|
ScStwAppSettings::~ScStwAppSettings()
|
|
{
|
|
}
|
|
|