[gnome-documents/wip/gepub: 6/6] evince: simplify code



commit b18ab39992ad3f68fffa675346e7f2d4a90a0329
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 21 13:33:54 2016 -0700

    evince: simplify code

 src/evinceview.js |   22 ++--------------------
 1 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/src/evinceview.js b/src/evinceview.js
index 7d85145..056ab39 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -628,18 +628,8 @@ const EvinceViewNavControls = new Lang.Class({
     Name: 'EvinceViewNavControls',
     Extends: Preview.PreviewNavControls,
 
-    _init: function(previewView, overlay) {
-        this._pageChangedId = 0;
-
-        this._previewView = previewView;
-        this._model = previewView.getModel();
-
-        this.parent(previewView, overlay);
-    },
-
     createBarWidget: function() {
-        let barWidget = new GdPrivate.NavBar({ document_model: this._model,
-                                               margin: Preview.PREVIEW_NAVBAR_MARGIN,
+        let barWidget = new GdPrivate.NavBar({ margin: Preview.PREVIEW_NAVBAR_MARGIN,
                                                valign: Gtk.Align.END,
                                                opacity: 0 });
 
@@ -665,16 +655,8 @@ const EvinceViewNavControls = new Lang.Class({
     },
 
     setModel: function(model) {
-        if (this._pageChangedId != 0) {
-            this._model.disconnect(this._pageChangedId);
-            this._pageChangedId = 0;
-        }
-
-        this._model = model;
         this.barWidget.document_model = model;
-
-        if (this._model)
-            this._pageChangedId = this._model.connect('page-changed', Lang.bind(this, 
this._updateVisibility));
+        model.connect('page-changed', Lang.bind(this, this._updateVisibility));
     }
 });
 


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