[gnome-documents] metadata: fixup previous commit
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] metadata: fixup previous commit
- Date: Tue, 17 Jul 2012 22:16:45 +0000 (UTC)
commit 1c2202ace57c4d79121f7a0d699bec9dff020dc1
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Jul 17 18:12:48 2012 -0400
metadata: fixup previous commit
Apparently EvinceView doesn't really like if we set certain document
model properties before calling ev_view_set_model(), so only initialize
metadata after we signalled the view that the document model is ready.
src/documents.js | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 04a60f9..0df0c60 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -1006,9 +1006,12 @@ const DocumentManager = new Lang.Class({
return;
}
- // save loaded model and connect metadata
- this._initLoadState(docModel);
+ // save loaded model and signal
+ this._activeDocModel = docModel;
this.emit('load-finished', doc, docModel);
+
+ // load metadata
+ this._connectMetadata(docModel);
},
setActiveItem: function(doc) {
@@ -1016,7 +1019,7 @@ const DocumentManager = new Lang.Class({
return;
// cleanup any state we have for previously loaded model
- this._cleanupLoadState();
+ this._clearActiveDocModel();
if (!doc)
return;
@@ -1034,7 +1037,7 @@ const DocumentManager = new Lang.Class({
this.emit('load-started', doc);
},
- _cleanupLoadState: function() {
+ _clearActiveDocModel: function() {
// cancel any pending load operation
if (this._loaderCancellable) {
this._loaderCancellable.cancel();
@@ -1053,9 +1056,7 @@ const DocumentManager = new Lang.Class({
}
},
- _initLoadState: function(docModel) {
- this._activeDocModel = docModel;
-
+ _connectMetadata: function(docModel) {
let evDoc = docModel.get_document();
let file = Gio.File.new_for_uri(evDoc.get_uri());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]