1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactoring

This commit is contained in:
krepa098 2015-01-17 11:31:57 +01:00
parent b4fa8323af
commit e85ff58223

View File

@ -433,25 +433,7 @@ void ChatLog::insertChatlineOnTop(ChatLine::Ptr l)
if(!l.get())
return;
bool stickToBtm = stickToBottom();
//move all lines down by 1
for(ChatLine::Ptr l : lines)
l->setRowIndex(l->getRowIndex() + 1);
//add the new line
l->addToScene(scene);
l->setRowIndex(0);
lines.prepend(l);
//full refresh is required
layout(0, lines.size(), useableWidth());
updateSceneRect();
if(stickToBtm)
scrollToBottom();
checkVisibility();
insertChatlineOnTop(QList<ChatLine::Ptr>() << l);
}
void ChatLog::insertChatlineOnTop(const QList<ChatLine::Ptr>& newLines)