projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9861cef
)
fixing dupes
author
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 1 Sep 2008 20:23:27 +0000
(22:23 +0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 1 Sep 2008 20:23:27 +0000
(22:23 +0200)
src/client/messagemodel.cpp
patch
|
blob
|
history
diff --git
a/src/client/messagemodel.cpp
b/src/client/messagemodel.cpp
index
245a787
..
7011bdf
100644
(file)
--- a/
src/client/messagemodel.cpp
+++ b/
src/client/messagemodel.cpp
@@
-119,6
+119,7
@@
void MessageModel::insertMessages(const QList<Message> &msglist) {
// and give back controll to the eventloop (similar to what the QtUiMessageProcessor used to do)
QList<Message> grouplist;
MsgId id;
// and give back controll to the eventloop (similar to what the QtUiMessageProcessor used to do)
QList<Message> grouplist;
MsgId id;
+ MsgId dupeId;
bool fastForward = false;
QList<Message>::const_iterator iter;
if(inOrder) {
bool fastForward = false;
QList<Message>::const_iterator iter;
if(inOrder) {
@@
-130,13
+131,16
@@
void MessageModel::insertMessages(const QList<Message> &msglist) {
// DUPE (1 / 3)
int idx = indexForId((*iter).msgId());
// DUPE (1 / 3)
int idx = indexForId((*iter).msgId());
+ if(idx > 0)
+ dupeId = _messageList[idx]->msgId();
// we always compare to the previous entry...
// if there isn't, we can fastforward to the top
if(idx - 1 >= 0) // also safe as we've passed another empty check
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
// we always compare to the previous entry...
// if there isn't, we can fastforward to the top
if(idx - 1 >= 0) // also safe as we've passed another empty check
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
- grouplist << *iter;
+ if((*iter).msgId() != dupeId)
+ grouplist << *iter;
if(!inOrder)
iter++;
if(!inOrder)
iter++;
@@
-151,12
+155,15
@@
void MessageModel::insertMessages(const QList<Message> &msglist) {
// build new group
int idx = indexForId((*iter).msgId());
// build new group
int idx = indexForId((*iter).msgId());
+ if(idx > 0)
+ dupeId = _messageList[idx]->msgId();
if(idx - 1 >= 0)
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
}
if(idx - 1 >= 0)
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
}
- grouplist.prepend(*iter);
+ if((*iter).msgId() != dupeId)
+ grouplist.prepend(*iter);
}
} else {
while(iter != msglist.constEnd()) {
}
} else {
while(iter != msglist.constEnd()) {
@@
-167,12
+174,15
@@
void MessageModel::insertMessages(const QList<Message> &msglist) {
// build new group
int idx = indexForId((*iter).msgId());
// build new group
int idx = indexForId((*iter).msgId());
+ if(idx > 0)
+ dupeId = _messageList[idx]->msgId();
if(idx - 1 >= 0)
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
}
if(idx - 1 >= 0)
id = _messageList[idx - 1]->msgId();
else
fastForward = true;
}
- grouplist.prepend(*iter);
+ if((*iter).msgId() != dupeId)
+ grouplist.prepend(*iter);
iter++;
}
}
iter++;
}
}