QTfrontend/chatwidget.cpp
changeset 1516 bb9fa5809c49
parent 1457 44cc464de8f3
child 1520 f72f538eba05
--- a/QTfrontend/chatwidget.cpp	Thu Nov 27 14:55:49 2008 +0000
+++ b/QTfrontend/chatwidget.cpp	Thu Nov 27 15:01:12 2008 +0000
@@ -63,10 +63,14 @@
 
 void HWChatWidget::onChatString(const QString& str)
 {
-  QListWidget* w = chatText;
-  w->addItem(str);
-  w->scrollToBottom();
-  w->setSelectionMode(QAbstractItemView::NoSelection);
+	QListWidget* w = chatText;
+	
+	if (w->count() > 250)
+		delete w->item(0);
+
+	w->addItem(str);
+	w->scrollToBottom();
+	w->setSelectionMode(QAbstractItemView::NoSelection);
 }
 
 void HWChatWidget::nickAdded(const QString& nick)