added new TupleTableModel for settingsdialog

This commit is contained in:
fourtf
2018-04-25 14:49:30 +02:00
parent 1edcfe5219
commit 859f4aefcb
18 changed files with 574 additions and 236 deletions
+13 -4
View File
@@ -10,13 +10,14 @@ namespace messages {
struct HighlightPhrase {
QString key;
bool sound;
bool alert;
bool sound;
bool regex;
bool operator==(const HighlightPhrase &rhs) const
bool operator==(const HighlightPhrase &other) const
{
return std::tie(this->key, this->sound, this->alert) ==
std::tie(rhs.key, rhs.sound, rhs.alert);
return std::tie(this->key, this->sound, this->alert, this->regex) ==
std::tie(other.key, other.sound, other.alert, other.regex);
}
};
} // namespace messages
@@ -35,6 +36,7 @@ struct Serialize<chatterino::messages::HighlightPhrase> {
AddMember(ret, "key", value.key, a);
AddMember(ret, "alert", value.alert, a);
AddMember(ret, "sound", value.sound, a);
AddMember(ret, "regex", value.regex, a);
return ret;
}
@@ -70,6 +72,13 @@ struct Deserialize<chatterino::messages::HighlightPhrase> {
}
}
if (value.HasMember("regex")) {
const rapidjson::Value &regex = value["regex"];
if (regex.IsBool()) {
ret.regex = regex.GetBool();
}
}
return ret;
}
};