[gnome-documents/wip/lokdocview-rebase: 8/13] Start loading LO docs when load-started is emitted



commit 1f114fb5a029ef44522c39723342105f633d94c7
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Dec 6 15:36:06 2015 +0100

    Start loading LO docs when load-started is emitted
    
    Note that this will break the Evince view because of the way signals are
    handled.

 src/lokview.js |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/lokview.js b/src/lokview.js
index 8724f85..fc44863 100644
--- a/src/lokview.js
+++ b/src/lokview.js
@@ -143,7 +143,12 @@ const LOKView = new Lang.Class({
            }));
     },
 
-    _onLoadStarted: function() {
+    _onLoadStarted: function(manager, doc) {
+        let file = Gio.File.new_for_uri (doc.uri);
+        let location = file.get_path();
+        this._doc = doc;
+        this.view.open_document(location, "{}", null, Lang.bind(this, this.open_document_cb));
+        this._progressBar.show();
     },
 
     _onLoadError: function(manager, doc, message, exception) {
@@ -167,13 +172,6 @@ const LOKView = new Lang.Class({
     },
 
     _onLoadFinished: function(manager, doc, docModel) {
-        if (docModel == null && doc != null) {
-            let file = Gio.File.new_for_uri (doc.uri);
-            let location = file.get_path();
-            this._doc = doc;
-            this.view.open_document(location, "{}", null, Lang.bind(this, this.open_document_cb));
-            this._progressBar.show();
-        }
     },
 
     reset: function () {


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