[gnome-documents] documents: don't block the mainloop while populating the model



commit 824c7f943219a4a1997cbf372ace44e047abe103
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Oct 31 17:46:27 2011 -0400

    documents: don't block the mainloop while populating the model
    
    Make sure to clear the pending events on the Gtk mainloop after we add
    an item to the list store.
    This ensures other parts of the UI (e.g. a spinner) stay responsive
    while loading the query results.

 src/documents.js |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index afe1a05..a73c3c8 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -688,6 +688,9 @@ DocumentModel.prototype = {
                                  doc.title, doc.author,
                                  doc.pixbuf, doc.mtime);
             }));
+
+        while (Gtk.events_pending())
+            Gtk.main_iteration();
     },
 
     documentRemoved: function(doc) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]