[gnome-documents] application: use addDocumentFromCursor to inesrt the preview item



commit 136f3192e4f2ec257591a75b35dd59a4579f4fe3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 12 21:41:59 2012 -0400

    application: use addDocumentFromCursor to inesrt the preview item
    
    This fixes categories not loading properly, since CategoryManager was
    not populated with the item.

 src/application.js |    4 ++--
 src/documents.js   |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index a78c21a..afab1f4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -210,8 +210,8 @@ Application.prototype = {
                     function(cursor) {
                         if (!cursor)
                             return;
-                        let doc = Global.documentManager.createDocumentFromCursor(cursor);
-                        Global.documentManager.addItem(doc);
+
+                        let doc = Global.documentManager.addDocumentFromCursor(cursor);
                         Global.documentManager.setActiveItem(doc);
                     }));
             }
diff --git a/src/documents.js b/src/documents.js
index 46d5940..feb1f19 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -882,6 +882,8 @@ DocumentManager.prototype = {
 
         if (doc.collection)
             Global.collectionManager.addItem(doc);
+
+        return doc;
     },
 
     clear: function() {



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