mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
refs #297 Added CSettingsCache singleton derived class of CValueCache
for core settings, with context signal and slot for relay.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "blackcore/context_application_proxy.h"
|
||||
#include "blackcore/context_settings.h"
|
||||
#include "blackcore/input_manager.h"
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include <QCoreApplication>
|
||||
@@ -46,9 +47,26 @@ namespace BlackCore
|
||||
this->logMessage(message, {});
|
||||
});
|
||||
|
||||
connect(CSettingsCache::instance(), &CSettingsCache::valuesChangedByLocal, [this](const CVariantMap &settings)
|
||||
{
|
||||
this->changeSettings(settings, {});
|
||||
});
|
||||
connect(this, &IContextApplication::settingsChanged, [](const CVariantMap &settings, const CIdentifier &origin)
|
||||
{
|
||||
// Intentionally don't check for round trip here
|
||||
CSettingsCache::instance()->changeValuesFromRemote(settings, origin);
|
||||
});
|
||||
|
||||
changeSettings(IContextSettings::SettingsHotKeys);
|
||||
}
|
||||
|
||||
void IContextApplication::changeSettings(const CVariantMap &settings, const CIdentifier &origin)
|
||||
{
|
||||
Q_UNUSED(settings);
|
||||
Q_UNUSED(origin);
|
||||
qFatal("Not implemented"); // avoid losing a change during context interface construction
|
||||
}
|
||||
|
||||
void IContextApplication::changeSettings(uint typeValue)
|
||||
{
|
||||
auto type = static_cast<IContextSettings::SettingsType>(typeValue);
|
||||
|
||||
Reference in New Issue
Block a user