X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=5072e384b2f7944346be0d52a83f04c6371e49f7;hb=d9f4d3f0eabd3767b4d25438319116f77c158c52;hp=af502819a8d06be20af1b8ba4069d6ab9821d586;hpb=ad1565e214bd8f51798d378ec82f4cdf094bd122;p=quassel.git diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index af502819..5072e384 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -170,7 +170,6 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) { qreal width = _sceneRect.width(); bool atBottom = (start == _lines.count()); bool atTop = !atBottom && (start == 0); - bool moveTop = false; if(start < _lines.count()) { y = _lines.value(start)->y(); @@ -844,7 +843,6 @@ void ChatScene::updateSceneRect(qreal width) { ChatLine *firstLine = _lines.at(_firstLineRow); ChatLine *lastLine = _lines.last(); updateSceneRect(QRectF(0, firstLine->pos().y(), width, lastLine->pos().y() + lastLine->height() - firstLine->pos().y())); - qDebug() << idString() << "top:" << sceneRect().y() << "height:" << sceneRect().height(); } else { // empty scene rect updateSceneRect(QRectF(0, 0, width, 0)); @@ -884,7 +882,7 @@ void ChatScene::loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRec // prepare to load a different URL if(webPreview.previewItem) { if(webPreview.previewItem->scene()) - removeItem(webPreview.previewItem); + removeItem(webPreview.previewItem); delete webPreview.previewItem; webPreview.previewItem = 0; } @@ -932,10 +930,10 @@ void ChatScene::webPreviewNextStep() { qreal previewY = webPreview.urlRect.bottom(); qreal previewX = webPreview.urlRect.x(); if(previewY + webPreview.previewItem->boundingRect().height() > sceneRect().bottom()) - previewY = webPreview.urlRect.y() - webPreview.previewItem->boundingRect().height(); + previewY = webPreview.urlRect.y() - webPreview.previewItem->boundingRect().height(); if(previewX + webPreview.previewItem->boundingRect().width() > sceneRect().width()) - previewX = sceneRect().right() - webPreview.previewItem->boundingRect().width(); + previewX = sceneRect().right() - webPreview.previewItem->boundingRect().width(); webPreview.previewItem->setPos(previewX, previewY); } @@ -970,7 +968,7 @@ void ChatScene::clearWebPreview(ChatItem *parentItem) { case WebPreview::ShowPreview: if(parentItem == 0 || webPreview.parentItem == parentItem) { if(webPreview.previewItem && webPreview.previewItem->scene()) - removeItem(webPreview.previewItem); + removeItem(webPreview.previewItem); } // fall through into to set hidden state case WebPreview::DelayPreview: