Use longer rainbow while executing "/rainbow".

This commit is contained in:
Black Hat
2018-08-06 05:00:06 +08:00
parent 6f8cd14e38
commit 640e3712a2
2 changed files with 8 additions and 7 deletions

View File

@@ -338,8 +338,7 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
if (e.hasFileContent()) {
auto fileCaption = e.content()->fileInfo()->originalName;
if (fileCaption.isEmpty())
fileCaption = e.plainBody();
if (fileCaption.isEmpty()) fileCaption = e.plainBody();
if (fileCaption.isEmpty()) return tr("a file");
}
return e.plainBody();
@@ -423,7 +422,6 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
tr("Unknown Event"));
}
if (role == Qt::ToolTipRole) {
return evt.originalJson();
}
@@ -515,11 +513,14 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
return role == TimeRole ? QVariant(ts) : renderDate(ts);
}
if (role == AboveSectionRole || role == AboveAuthorRole || role == AboveTimeRole)
if (role == AboveSectionRole || role == AboveAuthorRole ||
role == AboveTimeRole)
for (auto r = row + 1; r < rowCount(); ++r) {
auto i = index(r);
if (data(i, SpecialMarksRole) != EventStatus::Hidden)
return data(i, role == AboveSectionRole ? SectionRole : role == AboveAuthorRole ? AuthorRole : TimeRole);
return data(i, role == AboveSectionRole
? SectionRole
: role == AboveAuthorRole ? AuthorRole : TimeRole);
}
return {};