Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp index 1f377aa..724f4bd 100644 --- a/noncore/net/opieirc/ircservertab.cpp +++ b/noncore/net/opieirc/ircservertab.cpp | |||
@@ -1,61 +1,60 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "ircservertab.h" | 2 | #include "ircservertab.h" |
3 | 3 | ||
4 | IRCServerTab::IRCServerTab(IRCServer *server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { | 4 | IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { |
5 | m_server = server; | 5 | m_server = server; |
6 | m_session = new IRCSession(m_server); | 6 | m_session = new IRCSession(&m_server); |
7 | m_mainWindow = mainWindow; | 7 | m_mainWindow = mainWindow; |
8 | m_close = FALSE; | 8 | m_close = FALSE; |
9 | m_description->setText(tr("Connection to")+" <b>" + server->hostname() + ":" + QString::number(server->port()) + "</b>"); | 9 | m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); |
10 | m_textview = new QTextView(this); | 10 | m_textview = new QTextView(this); |
11 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); | 11 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); |
12 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); | 12 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); |
13 | m_layout->add(m_textview); | 13 | m_layout->add(m_textview); |
14 | m_field = new QLineEdit(this); | 14 | m_field = new QLineEdit(this); |
15 | m_layout->add(m_field); | 15 | m_layout->add(m_field); |
16 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 16 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
17 | m_field->setFocus(); | 17 | m_field->setFocus(); |
18 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); | 18 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); |
19 | } | 19 | } |
20 | 20 | ||
21 | void IRCServerTab::appendText(QString text) { | 21 | void IRCServerTab::appendText(QString text) { |
22 | /* not using append because it creates layout problems */ | 22 | /* not using append because it creates layout problems */ |
23 | m_textview->setText(m_textview->text() + text); | 23 | m_textview->setText(m_textview->text() + text); |
24 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 24 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
25 | } | 25 | } |
26 | 26 | ||
27 | IRCServerTab::~IRCServerTab() { | 27 | IRCServerTab::~IRCServerTab() { |
28 | QListIterator<IRCChannelTab> it(m_channelTabs); | 28 | QListIterator<IRCChannelTab> it(m_channelTabs); |
29 | for (; it.current(); ++it) { | 29 | for (; it.current(); ++it) { |
30 | m_mainWindow->killTab(it.current()); | 30 | m_mainWindow->killTab(it.current()); |
31 | } | 31 | } |
32 | delete m_session; | 32 | delete m_session; |
33 | delete m_server; | ||
34 | } | 33 | } |
35 | 34 | ||
36 | void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { | 35 | void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { |
37 | m_channelTabs.remove(tab); | 36 | m_channelTabs.remove(tab); |
38 | } | 37 | } |
39 | 38 | ||
40 | QString IRCServerTab::title() { | 39 | QString IRCServerTab::title() { |
41 | return "Server"; | 40 | return "Server"; |
42 | } | 41 | } |
43 | 42 | ||
44 | IRCSession *IRCServerTab::session() { | 43 | IRCSession *IRCServerTab::session() { |
45 | return m_session; | 44 | return m_session; |
46 | } | 45 | } |
47 | 46 | ||
48 | IRCServer *IRCServerTab::server() { | 47 | IRCServer *IRCServerTab::server() { |
49 | return m_server; | 48 | return &m_server; |
50 | } | 49 | } |
51 | 50 | ||
52 | void IRCServerTab::processCommand() { | 51 | void IRCServerTab::processCommand() { |
53 | m_field->clear(); | 52 | m_field->clear(); |
54 | appendText("<font color=\"#ff0000\">Not supported yet</font><br>"); | 53 | appendText("<font color=\"#ff0000\">Not supported yet</font><br>"); |
55 | } | 54 | } |
56 | 55 | ||
57 | void IRCServerTab::doConnect() { | 56 | void IRCServerTab::doConnect() { |
58 | m_session->beginSession(); | 57 | m_session->beginSession(); |
59 | } | 58 | } |
60 | 59 | ||
61 | void IRCServerTab::remove() { | 60 | void IRCServerTab::remove() { |