Fix off-by-one error in computeWrapList()
[quassel.git] / src / qtui / qtui.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-08 by the Quassel Project                          *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) version 3.                                           *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #include "qtui.h"
22
23 #include "chatlinemodel.h"
24 #include "mainwin.h"
25
26 QtUiStyle *QtUi::_style;
27
28 QtUi::QtUi()
29   : AbstractUi()
30 {
31   mainWin = new MainWin(this);
32   _style = new QtUiStyle;
33
34   connect(mainWin, SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &)));
35   connect(mainWin, SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore()));
36 }
37
38 QtUi::~QtUi() {
39   delete _style;
40   delete mainWin;
41 }
42
43 void QtUi::init() {
44   mainWin->init();
45 }
46
47 QtUiStyle *QtUi::style() {
48   return _style;
49 }
50
51 MessageModel *QtUi::createMessageModel(QObject *parent) {
52   return new ChatLineModel(parent);
53 }
54
55 AbstractUiMsg *QtUi::layoutMsg(const Message &msg) {
56   return 0;  // FIXME obsolete?
57 }
58
59 void QtUi::connectedToCore() {
60   mainWin->connectedToCore();
61 }
62
63 void QtUi::disconnectedFromCore() {
64   mainWin->disconnectedFromCore();
65 }