mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +08:00
refs #679 CApplication shall ensure CSettingsCache relay signal is connected when context is not available.
This commit is contained in:
@@ -207,6 +207,15 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool s = this->startHookIn();
|
bool s = this->startHookIn();
|
||||||
|
|
||||||
|
// enable local relay of settings changes in case there is no context
|
||||||
|
if (!this->supportsContexts())
|
||||||
|
{
|
||||||
|
connect(CSettingsCache::instance(), &CSettingsCache::valuesChangedByLocal, CSettingsCache::instance(), [](const CValueCachePacket & values)
|
||||||
|
{
|
||||||
|
CSettingsCache::instance()->changeValuesFromRemote(values, CIdentifier());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// trigger loading and saving of settings in appropriate scenarios
|
// trigger loading and saving of settings in appropriate scenarios
|
||||||
if (this->m_coreFacadeConfig.getModeApplication() != CCoreFacadeConfig::Remote)
|
if (this->m_coreFacadeConfig.getModeApplication() != CCoreFacadeConfig::Remote)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QMetaMethod>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
@@ -240,6 +241,9 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
if (values.valuesChanged()) { emit valuesChanged(values, sender()); }
|
if (values.valuesChanged()) { emit valuesChanged(values, sender()); }
|
||||||
emit valuesChangedByLocal(values);
|
emit valuesChangedByLocal(values);
|
||||||
|
|
||||||
|
Q_ASSERT_X(isSignalConnected(QMetaMethod::fromSignal(&CValueCache::valuesChangedByLocal)), Q_FUNC_INFO,
|
||||||
|
"signal must be connected for cache to function properly");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CValueCache::changeValuesFromRemote(const CValueCachePacket &values, const CIdentifier &originator)
|
void CValueCache::changeValuesFromRemote(const CValueCachePacket &values, const CIdentifier &originator)
|
||||||
|
|||||||
Reference in New Issue
Block a user