X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.cpp;h=a316ae15a9086cc8bb8b8c38454876af3a99a868;hp=48d8a70795833ff47e2be404c99d654bd8459b47;hb=5d9e6f82037c37c560827bfd9d71bc9467fa7ccc;hpb=6250a7e25eb2c0a6794d4aa5679c70082d825031 diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index 48d8a707..a316ae15 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel 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 * @@ -27,102 +27,19 @@ Buffer::Buffer(BufferInfo bufferid, QObject *parent) : QObject(parent), - _bufferInfo(bufferid), - _active(false) + _bufferInfo(bufferid) { - if(bufferid.buffer().isEmpty()) - _type = StatusType; - else if(isChannelName(bufferid.buffer())) - _type = ChannelType; - else - _type = QueryType; - -/* - QSettings s; - s.beginGroup(QString("GUI/BufferStates/%1/%2").arg(netname).arg(bufname)); - state->splitterState = s.value("Splitter").toByteArray(); - s.endGroup(); - */ - emit bufferUpdated(this); -} - -Buffer::~Buffer() { - //delete widget; - /* - QSettings s; - s.beginGroup(QString("GUI/BufferStates/%1/%2").arg(networkName).arg(bufferName)); - s.setValue("Splitter", state->splitterState); - s.endGroup(); -*/ - //delete state; -} - -Buffer::Type Buffer::bufferType() const { - return _type; -} - -bool Buffer::isActive() const { - // FIXME determine status by checking for a networkInfo objekt - return true; } BufferInfo Buffer::bufferInfo() const { - return _bufferInfo; -} - -void Buffer::updateBufferInfo(BufferInfo bufferid) { - _bufferInfo = bufferid; -} - -uint Buffer::uid() const { - return bufferInfo().uid(); -} - -uint Buffer::networkId() const { - return bufferInfo().networkId(); -} - -QString Buffer::networkName() const { - return bufferInfo().network(); -} - -QString Buffer::name() const { - if(bufferType() == StatusType) - return tr("Status Buffer"); - else - return bufferInfo().buffer(); + // still needed by the gui *sigh* to request the backlogs *sigh* + return _bufferInfo; } QList Buffer::contents() const { return layoutedMsgs; } -QVariantMap Buffer::nickList() const { - // FIXME should return a Map or List of IrcUsers in the future - return QVariantMap(); -} - -QString Buffer::topic() const { - // FIXME check if we got a networkInfo() object - return QString(); -} - -QString Buffer::ownNick() const { - // FIXME check if we got a networkInfo() object - return QString(); -} - -bool Buffer::isStatusBuffer() const { - return bufferType() == StatusType; -} - -void Buffer::setActive(bool a) { -// if(a != active) { -// active = a; -// emit bufferUpdated(this); -// } -} - void Buffer::appendMsg(const Message &msg) { AbstractUiMsg *m = Client::layoutMsg(msg); layoutedMsgs.append(m); @@ -142,43 +59,3 @@ bool Buffer::layoutMsg() { return layoutQueue.count(); } -void Buffer::processUserInput(QString msg) { - // TODO User Input processing (plugins) -> well, this goes through MainWin into Core for processing... so... - emit userInput(_bufferInfo, msg); -} - -// no longer needed -// back reference: -// void Buffer::setTopic(QString t) { -// _topic = t; -// emit topicSet(t); -// emit bufferUpdated(this); -// } - -// void Buffer::addNick(QString nick, QVariantMap props) { -// if(nick == ownNick()) setActive(true); -// nicks[nick] = props; -// emit nickListChanged(nicks); -// } - -// void Buffer::updateNick(QString nick, QVariantMap props) { -// nicks[nick] = props; -// emit nickListChanged(nicks); -// } - -// void Buffer::renameNick(QString oldnick, QString newnick) { -// QVariant v = nicks.take(oldnick); -// nicks[newnick] = v; -// emit nickListChanged(nicks); -// } - -// void Buffer::removeNick(QString nick) { -// if(nick == ownNick()) setActive(false); -// nicks.remove(nick); -// emit nickListChanged(nicks); -// } - -// void Buffer::setOwnNick(QString nick) { -// _ownNick = nick; -// emit ownNickSet(nick); -// }