Diffstat (limited to 'noncore/net/opieirc/ircquerytab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircquerytab.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircquerytab.cpp b/noncore/net/opieirc/ircquerytab.cpp index b946174..869e4f7 100644 --- a/noncore/net/opieirc/ircquerytab.cpp +++ b/noncore/net/opieirc/ircquerytab.cpp | |||
@@ -7,2 +7,3 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow | |||
7 | m_parentTab = parentTab; | 7 | m_parentTab = parentTab; |
8 | m_lines = 0; | ||
8 | m_person = new IRCPerson(*person); /* We need this (the person might sign off and the original IRCPerson gets deleted) */ | 9 | m_person = new IRCPerson(*person); /* We need this (the person might sign off and the original IRCPerson gets deleted) */ |
@@ -14,3 +15,3 @@ IRCQueryTab::IRCQueryTab(IRCPerson *person, IRCServerTab *parentTab, MainWindow | |||
14 | m_textview->setTextFormat(RichText); | 15 | m_textview->setTextFormat(RichText); |
15 | m_field = new QLineEdit(this); | 16 | m_field = new IRCHistoryLineEdit(this); |
16 | m_layout->add(hbox); | 17 | m_layout->add(hbox); |
@@ -25,3 +26,12 @@ void IRCQueryTab::appendText(QString text) { | |||
25 | /* not using append because it creates layout problems */ | 26 | /* not using append because it creates layout problems */ |
26 | m_textview->setText(m_textview->text() + text); | 27 | QString txt = m_textview->text() + text + "\n"; |
28 | if (m_maxLines > 0 && m_lines >= m_maxLines) { | ||
29 | int firstBreak = txt.find('\n'); | ||
30 | if (firstBreak != -1) { | ||
31 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); | ||
32 | } | ||
33 | } else { | ||
34 | m_lines++; | ||
35 | } | ||
36 | m_textview->setText(txt); | ||
27 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 37 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
@@ -65,2 +75,3 @@ void IRCQueryTab::settingsChanged() { | |||
65 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); | 75 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); |
76 | m_lines = 0; | ||
66 | } | 77 | } |