X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtopia%2Fmainwidget.cpp;h=4fde19b7f57b34db7fb512e612d34607868a59c6;hb=109e990662d25b98e5d5a159c4cad7c93e56b2fe;hp=65d528615a3864f829be18a7a9416ed39726f4fa;hpb=d47cd9b56ba10dc6e20baeabbd2b51305824b8c2;p=quassel.git diff --git a/src/qtopia/mainwidget.cpp b/src/qtopia/mainwidget.cpp index 65d52861..4fde19b7 100644 --- a/src/qtopia/mainwidget.cpp +++ b/src/qtopia/mainwidget.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * 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 * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -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 *)));