/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
{
switch (role) {
case MessageModel::FlagsRole:
- _styledMsg.setFlags((Message::Flags)value.toUInt());
+ _styledMsg.setFlags((Message::Flags)value.toInt());
return true;
default:
return MessageModelItem::setData(column, value, role);
case ChatLineModel::SelectedBackgroundRole:
return backgroundBrush(UiStyle::FormatType::Timestamp, true);
case ChatLineModel::FormatRole:
- return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Timestamp})});
+ return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Timestamp, {}, {}})});
}
return QVariant();
}
case ChatLineModel::SelectedBackgroundRole:
return backgroundBrush(UiStyle::FormatType::Sender, true);
case ChatLineModel::FormatRole:
- return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Sender})});
+ return QVariant::fromValue<UiStyle::FormatList>({std::make_pair(quint16{0}, UiStyle::Format{UiStyle::formatType(_styledMsg.type()) | UiStyle::FormatType::Sender, {}, {}})});
}
return QVariant();
}
QVariant ChatLineModelItem::backgroundBrush(UiStyle::FormatType subelement, bool selected) const
{
- QTextCharFormat fmt = QtUi::style()->format(UiStyle::formatType(_styledMsg.type()) | subelement,
+ QTextCharFormat fmt = QtUi::style()->format({UiStyle::formatType(_styledMsg.type()) | subelement, {}, {}},
messageLabel() | (selected ? UiStyle::MessageLabel::Selected : UiStyle::MessageLabel::None));
if (fmt.hasProperty(QTextFormat::BackgroundBrush))
return QVariant::fromValue<QBrush>(fmt.background());