From e85ff582230516ff72b2c4c1bd7da0a9267a72be Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 17 Jan 2015 11:31:57 +0100 Subject: [PATCH] refactoring --- src/chatlog/chatlog.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index b2d8239ad..4f07c9ad7 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -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() << l); } void ChatLog::insertChatlineOnTop(const QList& newLines)