Disabling indexing in the ChatScene as a workaround to keep quassel from crashing...
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 12 Oct 2008 12:00:32 +0000 (14:00 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sun, 12 Oct 2008 12:00:32 +0000 (14:00 +0200)
src/qtui/chatscene.cpp

index 40a0c8b..89d4422 100644 (file)
@@ -96,7 +96,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w
   connect(&webPreview.delayTimer, SIGNAL(timeout()), this, SLOT(showWebPreview()));
 
   // installEventFilter(this);
   connect(&webPreview.delayTimer, SIGNAL(timeout()), this, SLOT(showWebPreview()));
 
   // installEventFilter(this);
-  // setItemIndexMethod(QGraphicsScene::NoIndex);
+  setItemIndexMethod(QGraphicsScene::NoIndex);
 }
 
 ChatScene::~ChatScene() {
 }
 
 ChatScene::~ChatScene() {
@@ -192,6 +192,10 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) {
     }
   }
 
     }
   }
 
+  // check if all went right
+  Q_ASSERT(start == 0 || _lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height() == _lines.at(start)->pos().y());
+  Q_ASSERT(end + 1 == _lines.count() || _lines.at(end)->pos().y() + _lines.at(end)->height() == _lines.at(end + 1)->pos().y());
+
   if(!atBottom) {
     if(start < _firstLineRow) {
       int prevFirstLineRow = _firstLineRow + (end - start + 1);
   if(!atBottom) {
     if(start < _firstLineRow) {
       int prevFirstLineRow = _firstLineRow + (end - start + 1);