X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fbufferwidget.cpp;h=3f6ba6d25a42071e7c5c4fdc4162a3b67f423ace;hb=887c09b182a46886d9b0ba89e2c251164b6e8f0e;hp=c5fbff23c516f79685c29191f9725e20ec470127;hpb=9d54503555534a2c554f09a33df6afa33d6308ec;p=quassel.git diff --git a/src/qtui/bufferwidget.cpp b/src/qtui/bufferwidget.cpp index c5fbff23..3f6ba6d2 100644 --- a/src/qtui/bufferwidget.cpp +++ b/src/qtui/bufferwidget.cpp @@ -40,7 +40,8 @@ BufferWidget::BufferWidget(QWidget *parent) : AbstractBufferContainer(parent), _chatViewSearchController(new ChatViewSearchController(this)), - _autoMarkerLine(true) + _autoMarkerLine(true), + _autoMarkerLineOnLostFocus(true) { ui.setupUi(this); layout()->setContentsMargins(0, 0, 0, 0); @@ -99,6 +100,7 @@ BufferWidget::BufferWidget(QWidget *parent) ChatViewSettings s; s.initAndNotify("AutoMarkerLine", this, SLOT(setAutoMarkerLine(QVariant)), true); + s.initAndNotify("AutoMarkerLineOnLostFocus", this, SLOT(setAutoMarkerLineOnLostFocus(QVariant)), true); } @@ -114,6 +116,11 @@ void BufferWidget::setAutoMarkerLine(const QVariant &v) _autoMarkerLine = v.toBool(); } +void BufferWidget::setAutoMarkerLineOnLostFocus(const QVariant &v) +{ + _autoMarkerLineOnLostFocus = v.toBool(); +} + AbstractChatView *BufferWidget::createChatView(BufferId id) { @@ -270,14 +277,14 @@ void BufferWidget::setMarkerLine(ChatView *view, bool allowGoingBack) if (lastLine) { QModelIndex idx = lastLine->index(); MsgId msgId = idx.data(MessageModel::MsgIdRole).value(); + BufferId bufId = view->scene()->singleBufferId(); if (!allowGoingBack) { - BufferId bufId = view->scene()->singleBufferId(); MsgId oldMsgId = Client::markerLine(bufId); if (oldMsgId.isValid() && msgId <= oldMsgId) return; } - view->setMarkerLine(msgId); + Client::setMarkerLine(bufId, msgId); } }