X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fabstractbuffercontainer.cpp;h=f986c0b21241ad5ae4bef7370898fc49132e23f9;hb=c18e611a6b8c07049cc82b2dcdb5b138d9a6dd43;hp=ca9c101d449967a077d70eb47af3dfbb320f2053;hpb=54ead1bace1c9306ccfd5ebd7fb7bbd0c9843db7;p=quassel.git diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp index ca9c101d..f986c0b2 100644 --- a/src/uisupport/abstractbuffercontainer.cpp +++ b/src/uisupport/abstractbuffercontainer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -19,23 +19,17 @@ ***************************************************************************/ #include "abstractbuffercontainer.h" + #include "client.h" #include "clientbacklogmanager.h" #include "networkmodel.h" -AbstractBufferContainer::AbstractBufferContainer(QWidget *parent) - : AbstractItemView(parent), - _currentBuffer(0) -{ -} - - -AbstractBufferContainer::~AbstractBufferContainer() -{ -} - +AbstractBufferContainer::AbstractBufferContainer(QWidget* parent) + : AbstractItemView(parent) + , _currentBuffer(0) +{} -void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) +void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { Q_ASSERT(model()); if (!parent.isValid()) { @@ -45,7 +39,7 @@ void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, in if (model()->rowCount(parent) != end - start + 1) return; - foreach(BufferId id, _chatViews.keys()) { + foreach (BufferId id, _chatViews.keys()) { removeChatView(id); } _chatViews.clear(); @@ -63,7 +57,6 @@ void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, in } } - void AbstractBufferContainer::removeBuffer(BufferId bufferId) { if (!_chatViews.contains(bufferId)) @@ -73,7 +66,6 @@ void AbstractBufferContainer::removeBuffer(BufferId bufferId) _chatViews.take(bufferId); } - /* Switching to first buffer is now handled in MainWin::clientNetworkUpdated() @@ -93,7 +85,7 @@ void AbstractBufferContainer::rowsInserted(const QModelIndex &parent, int start, } */ -void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) +void AbstractBufferContainer::currentChanged(const QModelIndex& current, const QModelIndex& previous) { Q_UNUSED(previous) @@ -106,7 +98,6 @@ void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const Q } } - void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) { BufferId prevBufferId = currentBuffer(); @@ -126,9 +117,7 @@ void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) _currentBuffer = bufferId; showChatView(bufferId); - if (!Client::coreFeatures().testFlag(Quassel::Feature::BufferActivitySync)) { - Client::networkModel()->clearBufferActivity(bufferId); - } + Client::networkModel()->clearBufferActivity(bufferId); Client::setBufferLastSeenMsg(bufferId, _chatViews[bufferId]->lastMsgId()); Client::backlogManager()->checkForBacklog(bufferId); setFocus();