X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtopia%2Fmainwidget.cpp;h=4fde19b7f57b34db7fb512e612d34607868a59c6;hp=431a7300c503dcd5767785df6d7798df10ddaa60;hb=d298e7275374e2da41b0ed9ef1080464a77c8cf1;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016 diff --git a/src/qtopia/mainwidget.cpp b/src/qtopia/mainwidget.cpp index 431a7300..4fde19b7 100644 --- a/src/qtopia/mainwidget.cpp +++ b/src/qtopia/mainwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -37,6 +37,11 @@ MainWidget::~MainWidget() { } void MainWidget::setBuffer(Buffer *buf) { + if(!buf) { + ui.stack->setCurrentIndex(0); + currentBuffer = 0; + return; + } // TODO update topic if changed; handle status buffer display QString title = QString("%1 (%2): \"%3\"").arg(buf->name()).arg(buf->networkName()).arg(buf->topic()); ui.topicBar->setContents(title); @@ -50,10 +55,10 @@ void MainWidget::setBuffer(Buffer *buf) { ChatWidget *chatWidget; if(!chatWidgets.contains(buf)) { chatWidget = new ChatWidget(this); - QList lines; + QList lines; QList msgs = buf->contents(); foreach(AbstractUiMsg *msg, msgs) { - lines.append((ChatLine*)(msg)); + lines.append((ChatLineOld*)(msg)); } chatWidget->setContents(lines); connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));