Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (show 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 @@ #include <stdio.h> #include "ircservertab.h" -IRCServerTab::IRCServerTab(IRCServer *server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { +IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { m_server = server; - m_session = new IRCSession(m_server); + m_session = new IRCSession(&m_server); m_mainWindow = mainWindow; m_close = FALSE; - m_description->setText(tr("Connection to")+" <b>" + server->hostname() + ":" + QString::number(server->port()) + "</b>"); + m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); m_textview = new QTextView(this); m_textview->setHScrollBarMode(QScrollView::AlwaysOff); m_textview->setVScrollBarMode(QScrollView::AlwaysOn); m_layout->add(m_textview); m_field = new QLineEdit(this); m_layout->add(m_field); connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); m_field->setFocus(); connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); } void IRCServerTab::appendText(QString text) { /* not using append because it creates layout problems */ m_textview->setText(m_textview->text() + text); m_textview->ensureVisible(0, m_textview->contentsHeight()); } IRCServerTab::~IRCServerTab() { QListIterator<IRCChannelTab> it(m_channelTabs); for (; it.current(); ++it) { m_mainWindow->killTab(it.current()); } delete m_session; - delete m_server; } void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { m_channelTabs.remove(tab); } QString IRCServerTab::title() { return "Server"; } IRCSession *IRCServerTab::session() { return m_session; } IRCServer *IRCServerTab::server() { - return m_server; + return &m_server; } void IRCServerTab::processCommand() { m_field->clear(); appendText("<font color=\"#ff0000\">Not supported yet</font><br>"); } void IRCServerTab::doConnect() { m_session->beginSession(); } void IRCServerTab::remove() { |