X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fbuffersyncer.cpp;h=7198a464bb11462f25cb617fe2b81e10e2379932;hb=899709300734acc2bac01b1d57a1fd8fe2a6d923;hp=ca146b55b8b6590cf0c3980eb19b6ed4523dc43e;hpb=fd16e241d2fd1f33f4625b3255956f025a67273b;p=quassel.git diff --git a/src/common/buffersyncer.cpp b/src/common/buffersyncer.cpp index ca146b55..7198a464 100644 --- a/src/common/buffersyncer.cpp +++ b/src/common/buffersyncer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -128,7 +128,7 @@ void BufferSyncer::initSetMarkerLines(const QVariantList &list) QVariantList BufferSyncer::initActivities() const { QVariantList list; - QHash::const_iterator iter = _bufferActivities.constBegin(); + auto iter = _bufferActivities.constBegin(); while (iter != _bufferActivities.constEnd()) { list << QVariant::fromValue(iter.key()) << QVariant::fromValue((int) iter.value()); @@ -160,6 +160,8 @@ void BufferSyncer::removeBuffer(BufferId buffer) _lastSeenMsg.remove(buffer); if (_markerLines.contains(buffer)) _markerLines.remove(buffer); + if (_bufferActivities.contains(buffer)) + _bufferActivities.remove(buffer); SYNC(ARG(buffer)) emit bufferRemoved(buffer); } @@ -171,6 +173,8 @@ void BufferSyncer::mergeBuffersPermanently(BufferId buffer1, BufferId buffer2) _lastSeenMsg.remove(buffer2); if (_markerLines.contains(buffer2)) _markerLines.remove(buffer2); + if (_bufferActivities.contains(buffer2)) + _bufferActivities.remove(buffer2); SYNC(ARG(buffer1), ARG(buffer2)) emit buffersPermanentlyMerged(buffer1, buffer2); }