X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fabstractbuffercontainer.cpp;h=8fa435139eeb8dd684a9bbae71e7a123ee1828cd;hp=364fc4bab8d43a3b59c75edbedb7d27896ffebbd;hb=52cfbc8ee8f4da6f28c6afef089f8179434e717d;hpb=9d22ec1fd8e8652744e6ea6c91de4a6ec5b2146c diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp index 364fc4ba..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,17 +72,20 @@ 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()) { - qWarning() << "AbstractBufferContainer::setBuffer(BufferId): invalid BufferId:" << bufferId; _currentBuffer = 0; showChatView(0); return; @@ -92,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(); }