X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatlinemodelitem.cpp;fp=src%2Fqtui%2Fchatlinemodelitem.cpp;h=5c355821bdb576e43ebe93253c87e276b0b71833;hp=9ebc126498709cacfc929e6bf7335f7f201b4734;hb=41bf70c263ee0af80ad1850fabe77ffffee188f4;hpb=579e559a6322209df7cd51c34801fecff5fe734b diff --git a/src/qtui/chatlinemodelitem.cpp b/src/qtui/chatlinemodelitem.cpp index 9ebc1264..5c355821 100644 --- a/src/qtui/chatlinemodelitem.cpp +++ b/src/qtui/chatlinemodelitem.cpp @@ -76,7 +76,7 @@ bool ChatLineModelItem::setData(int column, const QVariant& value, int role) QVariant ChatLineModelItem::data(int column, int role) const { if (role == ChatLineModel::MsgLabelRole) - return QVariant::fromValue(messageLabel()); + return QVariant::fromValue(messageLabel()); QVariant variant; auto col = (MessageModel::ColumnType)column; @@ -110,8 +110,8 @@ QVariant ChatLineModelItem::timestampData(int role) const case ChatLineModel::SelectedBackgroundRole: return backgroundBrush(UiStyle::FormatType::Timestamp, true); case ChatLineModel::FormatRole: - return QVariant::fromValue( - {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(); } @@ -128,8 +128,8 @@ QVariant ChatLineModelItem::senderData(int role) const case ChatLineModel::SelectedBackgroundRole: return backgroundBrush(UiStyle::FormatType::Sender, true); case ChatLineModel::FormatRole: - return QVariant::fromValue( - {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(); } @@ -145,11 +145,11 @@ QVariant ChatLineModelItem::contentsData(int role) const case ChatLineModel::SelectedBackgroundRole: return backgroundBrush(UiStyle::FormatType::Contents, true); case ChatLineModel::FormatRole: - return QVariant::fromValue(_styledMsg.contentsFormatList()); + return QVariant::fromValue(_styledMsg.contentsFormatList()); case ChatLineModel::WrapListRole: if (_wrapList.isEmpty()) computeWrapList(); - return QVariant::fromValue(_wrapList); + return QVariant::fromValue(_wrapList); } return QVariant(); } @@ -171,7 +171,7 @@ QVariant ChatLineModelItem::backgroundBrush(UiStyle::FormatType subelement, bool 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(fmt.background()); + return QVariant::fromValue(fmt.background()); return QVariant(); }