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



commit dd135fb9d4e293bb5871f8caf3727eb9b21bfd47
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 c7806da..d133bd5 100644
--- a/src/lokview.js
+++ b/src/lokview.js
@@ -146,7 +146,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) {
@@ -171,13 +176,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]