- // we store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+CoreHighlightRuleManager::CoreHighlightRuleManager(CoreSession* session)
+ : HighlightRuleManager(session)
+ , _coreSession{session}
+{
+ // Load config from database if it exists
+ auto configMap = Core::getUserSetting(session->user(), settingsKey).toMap();
+ if (!configMap.isEmpty())
+ update(configMap);
+ // Otherwise, we just use the defaults initialized in the base class
+
+ // We store our settings whenever they change
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreHighlightRuleManager::save);