reformat code
This commit is contained in:
+12
-12
@@ -27,12 +27,12 @@ SettingsManager::SettingsManager()
|
||||
, mentionUsersWithAt(_settingsItems, "mentionUsersWithAt", false)
|
||||
, allowCommandsAtEnd(_settingsItems, "allowCommandsAtEnd", false)
|
||||
, enableHighlights(_settingsItems, "enableHighlights", true)
|
||||
, enableHighlightsSelf(_settingsItems,"enableHighlightsSelf", true)
|
||||
, enableHighlightsSelf(_settingsItems, "enableHighlightsSelf", true)
|
||||
, enableHighlightSound(_settingsItems, "enableHighlightSound", true)
|
||||
, enableHighlightTaskbar(_settingsItems, "enableHighlightTaskbar", true)
|
||||
, customHighlightSound(_settingsItems, "customHighlightSound", false)
|
||||
, pathHighlightSound(_settingsItems, "pathHighlightSound", "qrc:/sounds/ping2.wav")
|
||||
, highlightProperties(_settingsItems,"highlightProperties",QMap<QString,QPair<bool,bool>>())
|
||||
, highlightProperties(_settingsItems, "highlightProperties", QMap<QString, QPair<bool, bool>>())
|
||||
, enableTwitchEmotes(_settingsItems, "enableTwitchEmotes", true)
|
||||
, enableBttvEmotes(_settingsItems, "enableBttvEmotes", true)
|
||||
, enableFfzEmotes(_settingsItems, "enableFfzEmotes", true)
|
||||
@@ -64,17 +64,17 @@ SettingsManager::SettingsManager()
|
||||
void SettingsManager::save()
|
||||
{
|
||||
for (auto &item : _settingsItems) {
|
||||
if(item.get().getName() != "highlightProperties"){
|
||||
if (item.get().getName() != "highlightProperties") {
|
||||
_settings.setValue(item.get().getName(), item.get().getVariant());
|
||||
} else {
|
||||
_settings.beginGroup("Highlights");
|
||||
QStringList list = highlightProperties.get().keys();
|
||||
list.removeAll("");
|
||||
_settings.remove("");
|
||||
for (auto string : list){
|
||||
for (auto string : list) {
|
||||
_settings.beginGroup(string);
|
||||
_settings.setValue("highlightSound",highlightProperties.get().value(string).first);
|
||||
_settings.setValue("highlightTask",highlightProperties.get().value(string).second);
|
||||
_settings.setValue("highlightSound", highlightProperties.get().value(string).first);
|
||||
_settings.setValue("highlightTask", highlightProperties.get().value(string).second);
|
||||
_settings.endGroup();
|
||||
}
|
||||
_settings.endGroup();
|
||||
@@ -85,15 +85,16 @@ void SettingsManager::save()
|
||||
void SettingsManager::load()
|
||||
{
|
||||
for (auto &item : _settingsItems) {
|
||||
if(item.get().getName() != "highlightProperties"){
|
||||
if (item.get().getName() != "highlightProperties") {
|
||||
item.get().setVariant(_settings.value(item.get().getName()));
|
||||
} else {
|
||||
_settings.beginGroup("Highlights");
|
||||
QStringList list = _settings.childGroups();
|
||||
qDebug() << list.join(",");
|
||||
for (auto string : list){
|
||||
for (auto string : list) {
|
||||
_settings.beginGroup(string);
|
||||
highlightProperties.insertMap(string,_settings.value("highlightSound").toBool(),_settings.value("highlightTask").toBool());
|
||||
highlightProperties.insertMap(string, _settings.value("highlightSound").toBool(),
|
||||
_settings.value("highlightTask").toBool());
|
||||
_settings.endGroup();
|
||||
}
|
||||
_settings.endGroup();
|
||||
@@ -101,7 +102,6 @@ void SettingsManager::load()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Word::Type SettingsManager::getWordTypeMask()
|
||||
{
|
||||
return _wordTypeMask;
|
||||
@@ -159,8 +159,8 @@ SettingsSnapshot SettingsManager::createSnapshot()
|
||||
SettingsSnapshot snapshot;
|
||||
|
||||
for (auto &item : this->_settingsItems) {
|
||||
if(item.get().getName() != "highlightProperties"){
|
||||
snapshot.addItem(item, item.get().getVariant());
|
||||
if (item.get().getName() != "highlightProperties") {
|
||||
snapshot.addItem(item, item.get().getVariant());
|
||||
} else {
|
||||
snapshot._mapItems = highlightProperties.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user