fix: showInMentions attribute is now serialized correctly (#2137)

This was an error introduced in ec94869. Instead of the
Qt::CheckStateRole, which stores the state represented in the table
view, the Qt::DisplayRole was used. As per [1], this always returns
`false` in our use case.

[1]: https://doc.qt.io/qt-5/qvariant.html#toBool
This commit is contained in:
Leon Richardt 2020-10-26 10:06:09 +01:00 committed by GitHub
parent 466d85c907
commit 40da838a9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ HighlightPhrase HighlightModel::getItemFromRow(
return HighlightPhrase{ return HighlightPhrase{
row[Column::Pattern]->data(Qt::DisplayRole).toString(), row[Column::Pattern]->data(Qt::DisplayRole).toString(),
row[Column::ShowInMentions]->data(Qt::DisplayRole).toBool(), row[Column::ShowInMentions]->data(Qt::CheckStateRole).toBool(),
row[Column::FlashTaskbar]->data(Qt::CheckStateRole).toBool(), row[Column::FlashTaskbar]->data(Qt::CheckStateRole).toBool(),
row[Column::PlaySound]->data(Qt::CheckStateRole).toBool(), row[Column::PlaySound]->data(Qt::CheckStateRole).toBool(),
row[Column::UseRegex]->data(Qt::CheckStateRole).toBool(), row[Column::UseRegex]->data(Qt::CheckStateRole).toBool(),