Optimized fill of feed items by moving the fill of the hidden area to the first expand of the frame.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8514 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-17 18:59:12 +00:00
parent 4cb081f4ff
commit 846d5f4f50
27 changed files with 152 additions and 41 deletions

View file

@ -313,7 +313,9 @@ void GxsForumMsgItem::fill()
RetroShareLink msgLink;
msgLink.createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
ui->subLabel->setText(msgLink.toHtml());
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
if (wasExpanded() || ui->expandFrame->isVisible()) {
fillExpandFrame();
}
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
@ -355,12 +357,17 @@ void GxsForumMsgItem::fill()
mInFill = false;
}
void GxsForumMsgItem::fillExpandFrame()
{
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
}
QString GxsForumMsgItem::messageName()
{
return QString::fromUtf8(mMessage.mMeta.mMsgName.c_str());
}
void GxsForumMsgItem::expand(bool open)
void GxsForumMsgItem::doExpand(bool open)
{
if (mFeedHolder)
{
@ -395,6 +402,15 @@ void GxsForumMsgItem::expand(bool open)
}
}
void GxsForumMsgItem::expandFill(bool first)
{
GxsFeedItem::expandFill(first);
if (first) {
fillExpandFrame();
}
}
void GxsForumMsgItem::toggle()
{
expand(ui->expandFrame->isHidden());