/***************************************************************************
- * 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 *
#include "chatlinemodel.h"
-#include "chatlinemodelitem.h"
-
-ChatLineModel::ChatLineModel(QObject *parent) : MessageModel(parent) {
-
+ChatLineModel::ChatLineModel(QObject *parent)
+ : MessageModel(parent)
+{
}
-ChatLineModel::~ChatLineModel() {
+// MessageModelItem *ChatLineModel::createMessageModelItem(const Message &msg) {
+// return new ChatLineModelItem(msg);
+// }
+void ChatLineModel::insertMessages__(int pos, const QList<Message> &messages) {
+ for(int i = 0; i < messages.count(); i++) {
+ _messageList.insert(pos, ChatLineModelItem(messages[i]));
+ pos++;
+ }
}
-
-MessageModelItem *ChatLineModel::createMessageModelItem(const Message &msg) {
- return new ChatLineModelItem(msg);
-
+Message ChatLineModel::takeMessageAt(int i) {
+ Message msg = _messageList[i].message();
+ _messageList.removeAt(i);
+ return msg;
}