projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Greatly simplify the wrap point computation
[quassel.git]
/
src
/
common
/
buffersyncer.cpp
diff --git
a/src/common/buffersyncer.cpp
b/src/common/buffersyncer.cpp
index
c6fa1e7
..
82fe0da
100644
(file)
--- a/
src/common/buffersyncer.cpp
+++ b/
src/common/buffersyncer.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-0
8 by the Quassel IRC Team
*
+ * Copyright (C) 2005-0
9 by the Quassel Project
*
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-20,11
+20,17
@@
#include "buffersyncer.h"
#include "buffersyncer.h"
+INIT_SYNCABLE_OBJECT(BufferSyncer)
BufferSyncer::BufferSyncer(QObject *parent)
: SyncableObject(parent)
{
}
BufferSyncer::BufferSyncer(QObject *parent)
: SyncableObject(parent)
{
}
+BufferSyncer::BufferSyncer(const QHash<BufferId, MsgId> &lastSeenMsg, QObject *parent)
+ : SyncableObject(parent),
+ _lastSeenMsg(lastSeenMsg)
+{
+}
MsgId BufferSyncer::lastSeenMsg(BufferId buffer) const {
if(_lastSeenMsg.contains(buffer))
MsgId BufferSyncer::lastSeenMsg(BufferId buffer) const {
if(_lastSeenMsg.contains(buffer))
@@
-39,6
+45,7
@@
bool BufferSyncer::setLastSeenMsg(BufferId buffer, const MsgId &msgId) {
const MsgId oldLastSeenMsg = lastSeenMsg(buffer);
if(!oldLastSeenMsg.isValid() || oldLastSeenMsg < msgId) {
_lastSeenMsg[buffer] = msgId;
const MsgId oldLastSeenMsg = lastSeenMsg(buffer);
if(!oldLastSeenMsg.isValid() || oldLastSeenMsg < msgId) {
_lastSeenMsg[buffer] = msgId;
+ SYNC(ARG(buffer), ARG(msgId))
emit lastSeenMsgSet(buffer, msgId);
return true;
}
emit lastSeenMsgSet(buffer, msgId);
return true;
}
@@
-67,12
+74,13
@@
void BufferSyncer::initSetLastSeenMsg(const QVariantList &list) {
void BufferSyncer::removeBuffer(BufferId buffer) {
if(_lastSeenMsg.contains(buffer))
_lastSeenMsg.remove(buffer);
void BufferSyncer::removeBuffer(BufferId buffer) {
if(_lastSeenMsg.contains(buffer))
_lastSeenMsg.remove(buffer);
+ SYNC(ARG(buffer))
emit bufferRemoved(buffer);
}
emit bufferRemoved(buffer);
}
-
void BufferSyncer::mergeBuffersPermanently(BufferId buffer1, BufferId buffer2) {
if(_lastSeenMsg.contains(buffer2))
_lastSeenMsg.remove(buffer2);
void BufferSyncer::mergeBuffersPermanently(BufferId buffer1, BufferId buffer2) {
if(_lastSeenMsg.contains(buffer2))
_lastSeenMsg.remove(buffer2);
+ SYNC(ARG(buffer1), ARG(buffer2))
emit buffersPermanentlyMerged(buffer1, buffer2);
}
emit buffersPermanentlyMerged(buffer1, buffer2);
}