[gnome-documents] documents: Fix spinner starting after an error



commit 314d970b66f239b6eb6085c59ebf09f131a2d7f0
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Mar 2 14:13:31 2015 +0100

    documents: Fix spinner starting after an error
    
    In some circumstances, such as the PDF loading throwing an error during
    the load() call, the error signal could be received before
    "load-started" is, starting the spinner even though we can't make any
    progress.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745172

 src/documents.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index b40a068..420e421 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -1299,8 +1299,8 @@ const DocumentManager = new Lang.Class({
         this._clearActiveDocModel();
 
         this._loaderCancellable = new Gio.Cancellable();
-        doc.load(passwd, this._loaderCancellable, Lang.bind(this, this._onDocumentLoaded));
         this.emit('load-started', doc);
+        doc.load(passwd, this._loaderCancellable, Lang.bind(this, this._onDocumentLoaded));
     },
 
     removeItemById: function(id) {
@@ -1357,8 +1357,8 @@ const DocumentManager = new Lang.Class({
             recentManager.add_item(doc.uri);
 
             this._loaderCancellable = new Gio.Cancellable();
-            doc.load(null, this._loaderCancellable, Lang.bind(this, this._onDocumentLoaded));
             this.emit('load-started', doc);
+            doc.load(null, this._loaderCancellable, Lang.bind(this, this._onDocumentLoaded));
         }
 
         return retval;


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