projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f3fc032
)
SPUTDEV compiles again, and the MessageModel now actually is filled with messages...
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Sat, 26 Apr 2008 01:02:17 +0000
(
01:02
+0000)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Sat, 26 Apr 2008 01:02:17 +0000
(
01:02
+0000)
src/client/client.cpp
patch
|
blob
|
history
src/client/messagemodel.cpp
patch
|
blob
|
history
src/qtui/chatline.cpp
patch
|
blob
|
history
src/qtui/chatline.h
patch
|
blob
|
history
src/qtui/chatlinemodel.cpp
patch
|
blob
|
history
src/qtui/chatscene.cpp
patch
|
blob
|
history
src/qtui/chatview.cpp
patch
|
blob
|
history
src/qtui/chatview.h
patch
|
blob
|
history
src/qtui/mainwin.cpp
patch
|
blob
|
history
diff --git
a/src/client/client.cpp
b/src/client/client.cpp
index
64092dd
..
5f22eef
100644
(file)
--- a/
src/client/client.cpp
+++ b/
src/client/client.cpp
@@
-505,8
+505,8
@@
void Client::recvMessage(const Message &message) {
#else
void Client::recvMessage(const Message &msg) {
#else
void Client::recvMessage(const Message &msg) {
-
-
+ //checkForHighlight(msg);
+ _messageModel->insertMessage(msg);
}
#endif /* SPUTDEV */
}
#endif /* SPUTDEV */
@@
-515,8
+515,17
@@
void Client::recvStatusMsg(QString /*net*/, QString /*msg*/) {
//recvMessage(net, Message::server("", QString("[STATUS] %1").arg(msg)));
}
//recvMessage(net, Message::server("", QString("[STATUS] %1").arg(msg)));
}
+#ifdef SPUTDEV
+void Client::receiveBacklog(BufferId bufferId, const QVariantList &msgs) {
+ //checkForHighlight(msg);
+ foreach(QVariant v, msgs) {
+ _messageModel->insertMessage(v.value<Message>());
+ }
+}
+
+#else
+
void Client::receiveBacklog(BufferId bufferId, const QVariantList &msgs) {
void Client::receiveBacklog(BufferId bufferId, const QVariantList &msgs) {
-#ifndef SPUTDEV
Buffer *buffer_ = buffer(bufferId);
if(!buffer_) {
qWarning() << "Client::recvBacklogData(): received Backlog for unknown Buffer:" << bufferId;
Buffer *buffer_ = buffer(bufferId);
if(!buffer_) {
qWarning() << "Client::recvBacklogData(): received Backlog for unknown Buffer:" << bufferId;
@@
-542,8
+551,8
@@
void Client::receiveBacklog(BufferId bufferId, const QVariantList &msgs) {
if(!layoutTimer->isActive()) {
layoutTimer->start();
}
if(!layoutTimer->isActive()) {
layoutTimer->start();
}
-#endif
}
}
+#endif /* SPUTDEV */
void Client::layoutMsg() {
if(layoutQueue.isEmpty()) {
void Client::layoutMsg() {
if(layoutQueue.isEmpty()) {
diff --git
a/src/client/messagemodel.cpp
b/src/client/messagemodel.cpp
index
4e4b264
..
c41ad97
100644
(file)
--- a/
src/client/messagemodel.cpp
+++ b/
src/client/messagemodel.cpp
@@
-51,7
+51,7
@@
bool MessageModel::setData(const QModelIndex &index, const QVariant &value, int
void MessageModel::insertMessage(const Message &msg) {
MsgId id = msg.msgId();
void MessageModel::insertMessage(const Message &msg) {
MsgId id = msg.msgId();
- int idx = indexForId(id);
qDebug() << "inserting at" << idx << msg.text();
+ int idx = indexForId(id);
MessageItem *item = createMessageItem(msg);
beginInsertRows(QModelIndex(), idx, idx);
_messageList.insert(idx, item);
MessageItem *item = createMessageItem(msg);
beginInsertRows(QModelIndex(), idx, idx);
_messageList.insert(idx, item);
@@
-95,13
+95,13
@@
MessageItem::~MessageItem() {
}
QVariant MessageItem::data(int column, int role) const {
}
QVariant MessageItem::data(int column, int role) const {
- if(column < Timestamp
Role || column > TextRole
) return QVariant();
+ if(column < Timestamp
Column || column > TextColumn
) return QVariant();
switch(role) {
switch(role) {
- case M
sgIdRole: return _msgId
;
- case
BufferIdRole: return _bufferId
;
- case TypeRole: return _type;
- case
FlagsRole: return
_flags;
- case TimestampRole: return _timestamp;
+ case M
essageModel::MsgIdRole: return QVariant::fromValue<MsgId>(_msgId)
;
+ case
MessageModel::BufferIdRole: return QVariant::fromValue<BufferId>(_bufferId)
;
+ case
MessageModel::
TypeRole: return _type;
+ case
MessageModel::FlagsRole: return (int)
_flags;
+ case
MessageModel::
TimestampRole: return _timestamp;
default: return QVariant();
}
}
default: return QVariant();
}
}
diff --git
a/src/qtui/chatline.cpp
b/src/qtui/chatline.cpp
index
edb89f1
..
ef59fc4
100644
(file)
--- a/
src/qtui/chatline.cpp
+++ b/
src/qtui/chatline.cpp
@@
-20,9
+20,16
@@
#include "chatline.h"
#include "chatline.h"
-Chatline::Chatline(const
Q
Message &msg) : MessageItem(msg) {
+Chatline::Chatline(const Message &msg) : MessageItem(msg) {
}
}
+QVariant Chatline::data(int column, int role) const {
+ return MessageItem::data(column, role);
+}
+
+bool Chatline::setData(int column, const QVariant &value, int role) {
+ return false;
+}
diff --git
a/src/qtui/chatline.h
b/src/qtui/chatline.h
index
c16de80
..
087e2e8
100644
(file)
--- a/
src/qtui/chatline.h
+++ b/
src/qtui/chatline.h
@@
-21,10
+21,13
@@
#ifndef CHATLINE_H_
#define CHATLINE_H_
#ifndef CHATLINE_H_
#define CHATLINE_H_
+#include "messagemodel.h"
+
class Chatline : public MessageItem {
public:
Chatline(const Message &);
class Chatline : public MessageItem {
public:
Chatline(const Message &);
+ //virtual ~Chatline() {};
virtual QVariant data(int column, int role) const;
virtual bool setData(int column, const QVariant &value, int role);
virtual QVariant data(int column, int role) const;
virtual bool setData(int column, const QVariant &value, int role);
diff --git
a/src/qtui/chatlinemodel.cpp
b/src/qtui/chatlinemodel.cpp
index
9d640d8
..
09904e2
100644
(file)
--- a/
src/qtui/chatlinemodel.cpp
+++ b/
src/qtui/chatlinemodel.cpp
@@
-20,6
+20,8
@@
#include "chatlinemodel.h"
#include "chatlinemodel.h"
+#include "chatline.h"
+
ChatlineModel::ChatlineModel(QObject *parent) : MessageModel(parent) {
ChatlineModel::ChatlineModel(QObject *parent) : MessageModel(parent) {
@@
-31,6
+33,6
@@
ChatlineModel::~ChatlineModel() {
MessageItem *ChatlineModel::createMessageItem(const Message &msg) {
MessageItem *ChatlineModel::createMessageItem(const Message &msg) {
- return
0
;
+ return
new Chatline(msg)
;
}
}
diff --git
a/src/qtui/chatscene.cpp
b/src/qtui/chatscene.cpp
index
1d00876
..
669f746
100644
(file)
--- a/
src/qtui/chatscene.cpp
+++ b/
src/qtui/chatscene.cpp
@@
-42,23
+42,28
@@
ChatScene::~ChatScene() {
}
void ChatScene::appendMsg(AbstractUiMsg * msg) {
}
void ChatScene::appendMsg(AbstractUiMsg * msg) {
+ /*
ChatLine *line = dynamic_cast<ChatLine*>(msg);
Q_ASSERT(line);
_lines.append(line);
addItem(line);
line->setPos(0, _lines.count() * 30);
line->setColumnWidths(80, 80, 400);
ChatLine *line = dynamic_cast<ChatLine*>(msg);
Q_ASSERT(line);
_lines.append(line);
addItem(line);
line->setPos(0, _lines.count() * 30);
line->setColumnWidths(80, 80, 400);
+ */
}
void ChatScene::prependMsg(AbstractUiMsg * msg) {
}
void ChatScene::prependMsg(AbstractUiMsg * msg) {
+ /*
ChatLine *line = dynamic_cast<ChatLine*>(msg);
Q_ASSERT(line); qDebug() << "prepending";
_lines.prepend(line);
addItem(line);
line->setPos(0, _lines.count() * 30);
ChatLine *line = dynamic_cast<ChatLine*>(msg);
Q_ASSERT(line); qDebug() << "prepending";
_lines.prepend(line);
addItem(line);
line->setPos(0, _lines.count() * 30);
+ */
}
void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {
}
void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {
+ /*
qDebug() << "recv" << mouseEvent->scenePos();
ChatLine *line = static_cast<ChatLine*>(itemAt(mouseEvent->scenePos()));
ChatItem *item = static_cast<ChatItem*>(itemAt(mouseEvent->scenePos()));
qDebug() << "recv" << mouseEvent->scenePos();
ChatLine *line = static_cast<ChatLine*>(itemAt(mouseEvent->scenePos()));
ChatItem *item = static_cast<ChatItem*>(itemAt(mouseEvent->scenePos()));
@@
-66,4
+71,5
@@
void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {
if(line) {
line->myMousePressEvent(mouseEvent);
} else QGraphicsScene::mousePressEvent(mouseEvent);
if(line) {
line->myMousePressEvent(mouseEvent);
} else QGraphicsScene::mousePressEvent(mouseEvent);
+ */
}
}
diff --git
a/src/qtui/chatview.cpp
b/src/qtui/chatview.cpp
index
54ca6f9
..
db93f07
100644
(file)
--- a/
src/qtui/chatview.cpp
+++ b/
src/qtui/chatview.cpp
@@
-50,9
+50,9
@@
void ChatView::clear()
}
void ChatView::prependMsg(AbstractUiMsg *msg) {
}
void ChatView::prependMsg(AbstractUiMsg *msg) {
- ChatLine *line = dynamic_cast<ChatLine*>(msg);
- Q_ASSERT(line);
- prependChatLine(line);
+
//
ChatLine *line = dynamic_cast<ChatLine*>(msg);
+
//
Q_ASSERT(line);
+
//
prependChatLine(line);
}
void ChatView::prependChatLine(ChatLine *line) {
}
void ChatView::prependChatLine(ChatLine *line) {
@@
-64,9
+64,9
@@
void ChatView::prependChatLines(QList<ChatLine *> clist) {
}
void ChatView::appendMsg(AbstractUiMsg *msg) {
}
void ChatView::appendMsg(AbstractUiMsg *msg) {
- ChatLine *line = dynamic_cast<ChatLine*>(msg);
- Q_ASSERT(line);
- appendChatLine(line);
+
//
ChatLine *line = dynamic_cast<ChatLine*>(msg);
+
//
Q_ASSERT(line);
+
//
appendChatLine(line);
}
void ChatView::appendChatLine(ChatLine *line) {
}
void ChatView::appendChatLine(ChatLine *line) {
@@
-75,9
+75,9
@@
void ChatView::appendChatLine(ChatLine *line) {
void ChatView::appendChatLines(QList<ChatLine *> list) {
void ChatView::appendChatLines(QList<ChatLine *> list) {
- foreach(ChatLine *line, list) {
+
//
foreach(ChatLine *line, list) {
- }
+
//
}
}
void ChatView::setContents(const QList<AbstractUiMsg *> &list) {
}
void ChatView::setContents(const QList<AbstractUiMsg *> &list) {
diff --git
a/src/qtui/chatview.h
b/src/qtui/chatview.h
index
cc627c7
..
7ae7c8d
100644
(file)
--- a/
src/qtui/chatview.h
+++ b/
src/qtui/chatview.h
@@
-18,8
+18,8
@@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef
_
CHATVIEW_H_
-#define
_
CHATVIEW_H_
+#ifndef CHATVIEW_H_
+#define CHATVIEW_H_
#include <QGraphicsView>
#include <QGraphicsView>
diff --git
a/src/qtui/mainwin.cpp
b/src/qtui/mainwin.cpp
index
c0f07a2
..
5e6cfad
100644
(file)
--- a/
src/qtui/mainwin.cpp
+++ b/
src/qtui/mainwin.cpp
@@
-487,7
+487,8
@@
void MainWin::setDisconnectedState() {
AbstractUiMsg *MainWin::layoutMsg(const Message &msg) {
#ifdef SPUTDEV
AbstractUiMsg *MainWin::layoutMsg(const Message &msg) {
#ifdef SPUTDEV
- return new ChatLine(msg);
+ //return new ChatLine(msg);
+ return 0;
#else
return new ChatLineOld(msg);
#endif
#else
return new ChatLineOld(msg);
#endif