Make QuasselTopia run on the Greenphone! \o/
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Nov 2007 20:20:31 +0000 (20:20 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Nov 2007 20:20:31 +0000 (20:20 +0000)
Note to all: Don't use dynamic_cast in modules that are used by
             QuasselTopia. It's not supported on the greenphone.

src/qtopia/chatwidget.cpp
src/qtopia/mainwidget.cpp

index 4475962..e60083b 100644 (file)
@@ -34,13 +34,13 @@ void ChatWidget::setContents(QList<ChatLine *> lines) {
 }
 
 void ChatWidget::prependMsg(AbstractUiMsg *msg) {
-  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  ChatLine *line = static_cast<ChatLine*>(msg);
   Q_ASSERT(line);
   prependChatLine(line);
 }
 
 void ChatWidget::appendMsg(AbstractUiMsg *msg) {
-  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  ChatLine *line = static_cast<ChatLine*>(msg);
   Q_ASSERT(line);
   appendChatLine(line);
 }
index 3213e2c..0c9a1ee 100644 (file)
@@ -57,7 +57,7 @@ void MainWidget::setBuffer(Buffer *buf) {
     QList<ChatLine *> lines;
     QList<AbstractUiMsg *> msgs = buf->contents();
     foreach(AbstractUiMsg *msg, msgs) {
-      lines.append(dynamic_cast<ChatLine*>(msg));
+      lines.append((ChatLine*)(msg));
     }
     chatWidget->setContents(lines);
     connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));