2021-11-19 21:54:45 +03:00
|
|
|
/*
|
2023-12-31 09:23:23 +01:00
|
|
|
* Copyright (C) 2018-2024 QuasarApp.
|
2021-11-19 21:54:45 +03:00
|
|
|
* Distributed under the lgplv3 software license, see the accompanying
|
|
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
* of this license document, but changing it is not allowed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "isettings.h"
|
|
|
|
#include "settingslistner.h"
|
|
|
|
|
|
|
|
namespace QuasarAppUtils {
|
|
|
|
|
|
|
|
SettingsListner::SettingsListner() {
|
|
|
|
|
2022-06-21 19:14:59 +03:00
|
|
|
auto settings = ISettings::instance();
|
2021-11-20 13:19:23 +03:00
|
|
|
if (settings) {
|
2021-11-19 21:54:45 +03:00
|
|
|
|
2021-11-20 13:19:23 +03:00
|
|
|
auto listner = [this](QString key, QVariant val){
|
|
|
|
this->handleSettingsChanged(key, val);
|
|
|
|
};
|
2021-11-19 21:54:45 +03:00
|
|
|
|
2021-11-20 13:19:23 +03:00
|
|
|
_listnerConnection = QObject::connect(settings,
|
|
|
|
&ISettings::valueChanged,
|
|
|
|
listner);
|
2021-11-19 21:54:45 +03:00
|
|
|
}
|
2021-11-20 13:19:23 +03:00
|
|
|
}
|
2021-11-19 21:54:45 +03:00
|
|
|
|
2021-11-20 13:19:23 +03:00
|
|
|
SettingsListner::~SettingsListner() {
|
|
|
|
QObject::disconnect(_listnerConnection);
|
2021-11-19 21:54:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|