update search results when fetching backlog
authorDaniel Albers <daniel@lbers.com>
Mon, 1 Mar 2010 21:28:48 +0000 (22:28 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 3 Mar 2010 02:28:55 +0000 (03:28 +0100)
Introduces the signal MessageModel::finishedBacklogFetch(BufferId)

src/client/messagemodel.cpp
src/client/messagemodel.h
src/qtui/chatviewsearchcontroller.cpp

index d10a9bc..0cc31a1 100644 (file)
@@ -387,8 +387,10 @@ void MessageModel::messagesReceived(BufferId bufferId, int count) {
     return;
 
   _messagesWaiting[bufferId] -= count;
-  if(_messagesWaiting[bufferId] <= 0)
+  if(_messagesWaiting[bufferId] <= 0) {
     _messagesWaiting.remove(bufferId);
+    emit finishedBacklogFetch(bufferId);
+  }
 }
 
 void MessageModel::buffersPermanentlyMerged(BufferId bufferId1, BufferId bufferId2) {
index f4a7655..2439d1e 100644 (file)
@@ -71,6 +71,9 @@ public:
 
   void clear();
 
+signals:
+  void finishedBacklogFetch(BufferId bufferId);
+
 public slots:
   void requestBacklog(BufferId bufferId);
   void messagesReceived(BufferId bufferId, int count);
index 671ac72..8e72aef 100644 (file)
@@ -61,6 +61,7 @@ void ChatViewSearchController::setSearchString(const QString &searchString) {
 
   if(_scene) {
     disconnect(_scene, 0, this, 0);
+    disconnect(Client::messageModel(), 0, this, 0);
     qDeleteAll(_highlightItems);
     _highlightItems.clear();
   }
@@ -71,6 +72,7 @@ void ChatViewSearchController::setSearchString(const QString &searchString) {
 
   connect(_scene, SIGNAL(destroyed()), this, SLOT(sceneDestroyed()));
   connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights()));
+  connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights()));
   updateHighlights();
  }