X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fabstractbuffercontainer.cpp;h=8fa435139eeb8dd684a9bbae71e7a123ee1828cd;hp=ed898e916ef6584f3661916aa9d1324857b69cb6;hb=86bd6b1ffb870e65af6d830a2ea16471c348ed5a;hpb=1e9ed0de6263ad846de870fd1dad7561280bbf69 diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp index ed898e91..8fa43513 100644 --- a/src/uisupport/abstractbuffercontainer.cpp +++ b/src/uisupport/abstractbuffercontainer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,7 @@ #include "abstractbuffercontainer.h" #include "client.h" +#include "clientbacklogmanager.h" #include "networkmodel.h" AbstractBufferContainer::AbstractBufferContainer(QWidget *parent) @@ -71,13 +72,17 @@ void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const Q if(newBufferId != oldBufferId) { setCurrentBuffer(newBufferId); emit currentChanged(newBufferId); + emit currentChanged(current); } } void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) { BufferId prevBufferId = currentBuffer(); if(prevBufferId.isValid() && _chatViews.contains(prevBufferId)) { - Client::setBufferLastSeenMsg(prevBufferId, _chatViews[prevBufferId]->lastMsgId()); + MsgId msgId = _chatViews.value(prevBufferId)->lastMsgId(); + Client::setBufferLastSeenMsg(prevBufferId, msgId); + if(autoSetMarkerLine()) + Client::setBufferMarkerLine(prevBufferId, msgId); } if(!bufferId.isValid()) { @@ -91,7 +96,8 @@ void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) { _currentBuffer = bufferId; showChatView(bufferId); - Client::networkModel()->setBufferActivity(bufferId, Buffer::NoActivity); - // Client::setBufferLastSeenMsg(bufferId, _chatViews[bufferId]->lastMsgId()); + Client::networkModel()->clearBufferActivity(bufferId); + Client::setBufferLastSeenMsg(bufferId, _chatViews[bufferId]->lastMsgId()); + Client::backlogManager()->checkForBacklog(bufferId); setFocus(); }