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

@ -69,7 +69,6 @@ MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, const std::string &msgId,
updateItem();
}
void MsgItem::updateItemStatic()
{
/* fill in */
@ -148,8 +147,11 @@ void MsgItem::updateItemStatic()
titleLabel->setText(title);
subjectLabel->setText(QString::fromUtf8(mi.title.c_str()));
msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mi.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
mMsg = QString::fromUtf8(mi.msg.c_str());
if (wasExpanded() || expandFrame->isVisible()) {
fillExpandFrame();
}
std::list<FileInfo>::iterator it;
for(it = mi.files.begin(); it != mi.files.end(); ++it)
@ -175,6 +177,10 @@ void MsgItem::updateItemStatic()
}
}
void MsgItem::fillExpandFrame()
{
msgLabel->setText(RsHtml().formatText(NULL, mMsg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
}
void MsgItem::updateItem()
{
@ -207,7 +213,7 @@ void MsgItem::toggle()
expand(expandFrame->isHidden());
}
void MsgItem::expand(bool open)
void MsgItem::doExpand(bool open)
{
if (mParent) {
mParent->lockLayout(this, true);
@ -237,6 +243,15 @@ void MsgItem::expand(bool open)
}
}
void MsgItem::expandFill(bool first)
{
FeedItem::expandFill(first);
if (first) {
fillExpandFrame();
}
}
void MsgItem::removeItem()
{
#ifdef DEBUG_ITEM