[gnome-documents/wip/gepub: 4/6] preview: trivial code cleanups



commit e4e556e184f5d5a8fa47c704fe4f3aac87159ba1
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 21 21:36:24 2016 -0700

    preview: trivial code cleanups

 src/edit.js       |    1 -
 src/epubview.js   |    6 ------
 src/evinceview.js |    6 ++----
 src/lokview.js    |   12 +++---------
 4 files changed, 5 insertions(+), 20 deletions(-)
---
diff --git a/src/edit.js b/src/edit.js
index 187b1ea..02eb0e4 100644
--- a/src/edit.js
+++ b/src/edit.js
@@ -39,7 +39,6 @@ const EditView = new Lang.Class({
         this._uri = null;
 
         this.parent();
-        this.get_style_context().add_class('documents-scrolledwin');
 
         let context = WebKit.WebContext.get_default();
 
diff --git a/src/epubview.js b/src/epubview.js
index 1ee2577..99f3227 100644
--- a/src/epubview.js
+++ b/src/epubview.js
@@ -19,22 +19,16 @@
  *
  */
 
-const GLib = imports.gi.GLib;
 const Gepub = imports.gi.Gepub;
 const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
 const WebKit2 = imports.gi.WebKit2;
 
 const _ = imports.gettext.gettext;
 
-const Application = imports.application;
 const Documents = imports.documents;
-const MainToolbar = imports.mainToolbar;
 const Preview = imports.preview;
-const Searchbar = imports.searchbar;
 
 const Lang = imports.lang;
-const Signals = imports.signals;
 
 function isEpub(mimeType) {
     return (mimeType == 'application/epub+zip');
diff --git a/src/evinceview.js b/src/evinceview.js
index d382f9a..8190a17 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -31,14 +31,12 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 
 const Application = imports.application;
-const MainToolbar = imports.mainToolbar;
+const Documents = imports.documents;
 const Places = imports.places;
+const Presentation = imports.presentation;
 const Preview = imports.preview;
-const Searchbar = imports.searchbar;
 const Utils = imports.utils;
 const WindowMode = imports.windowMode;
-const Presentation = imports.presentation;
-const Documents = imports.documents;
 
 const _FULLSCREEN_TOOLBAR_TIMEOUT = 2; // seconds
 
diff --git a/src/lokview.js b/src/lokview.js
index 8b4c690..3aa8c7e 100644
--- a/src/lokview.js
+++ b/src/lokview.js
@@ -32,12 +32,9 @@ const Gtk = imports.gi.Gtk;
 const _ = imports.gettext.gettext;
 
 const Lang = imports.lang;
-const Signals = imports.signals;
 
-const Application = imports.application;
-const MainToolbar = imports.mainToolbar;
-const Preview = imports.preview;
 const Documents = imports.documents;
+const Preview = imports.preview;
 const Utils = imports.utils;
 
 const ZOOM_IN_FACTOR = 1.2;
@@ -101,8 +98,6 @@ const LOKView = new Lang.Class({
     _init: function(overlay, mainWindow) {
         this.parent(overlay, mainWindow);
 
-        this._uri = null;
-
         this._progressBar = new Gtk.ProgressBar({ halign: Gtk.Align.FILL,
                                                   valign: Gtk.Align.START });
         this._progressBar.get_style_context().add_class('osd');
@@ -151,11 +146,11 @@ const LOKView = new Lang.Class({
         if (!isAvailable())
             return;
         this._doc = doc;
-        this._lokview.open_document(doc.uri, "{}", null, Lang.bind(this, this.open_document_cb));
+        this._lokview.open_document(doc.uri, '{}', null, Lang.bind(this, this._onDocumentOpened));
         this._progressBar.show();
     },
 
-    open_document_cb: function(res, doc) {
+    _onDocumentOpened: function(res, doc) {
         // TODO: Call _finish and check failure
         this._progressBar.hide();
         this.set_visible_child_name('view');
@@ -247,4 +242,3 @@ const LOKView = new Lang.Class({
         return this._lokview.get_parts();
     }
 });
-Signals.addSignalMethods(LOKView.prototype);


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