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



commit b9644b921ac880fc821ef62e7d4328f6892711d3
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 0790f81..2f8b2db 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) {
@@ -170,13 +175,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]