[gnome-documents] Remove PREVIEW_EV window-mode special cases



commit 1d7469a85429ee164a27e51580dfba7c36f15fb7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Oct 23 20:01:07 2016 -0700

    Remove PREVIEW_EV window-mode special cases
    
    These are not needed anymore, and are already broken for other preview
    backends.

 src/application.js |   12 ++++--------
 src/edit.js        |    1 -
 src/evinceview.js  |   11 -----------
 src/windowMode.js  |    2 +-
 4 files changed, 5 insertions(+), 21 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 0f2fc53..b0db381 100644
--- a/src/application.js
+++ b/src/application.js
@@ -507,7 +507,6 @@ const Application = new Lang.Class({
 
     _onActivateResult: function(provider, urn, terms, timestamp) {
         this._createWindow();
-        modeController.setWindowMode(WindowMode.WindowMode.PREVIEW_EV);
 
         let doc = documentManager.getItemById(urn);
         if (doc) {
@@ -532,13 +531,10 @@ const Application = new Lang.Class({
             // forward the search terms next time we enter the overview
             let modeChangeId = modeController.connect('window-mode-changed', Lang.bind(this,
                 function(object, newMode) {
-                    if (newMode == WindowMode.WindowMode.EDIT
-                        || newMode == WindowMode.WindowMode.PREVIEW_EV)
-                        return;
-
-                    modeController.disconnect(modeChangeId);
-
-                    searchController.setString(terms.join(' '));
+                    if (newMode == WindowMode.WindowMode.DOCUMENTS) {
+                        modeController.disconnect(modeChangeId);
+                        searchController.setString(terms.join(' '));
+                    }
                 }));
         }
     },
diff --git a/src/edit.js b/src/edit.js
index 954c37d..8ec6c0e 100644
--- a/src/edit.js
+++ b/src/edit.js
@@ -28,7 +28,6 @@ const Mainloop = imports.mainloop;
 const Application = imports.application;
 const MainToolbar = imports.mainToolbar;
 const Preview = imports.preview;
-const WindowMode = imports.windowMode;
 
 const _BLANK_URI = "about:blank";
 
diff --git a/src/evinceview.js b/src/evinceview.js
index 5e0f9c9..02c890e 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -55,9 +55,6 @@ const EvinceView = new Lang.Class({
 
         this.parent(overlay, mainWindow);
 
-        Application.modeController.connect('window-mode-changed', Lang.bind(this,
-            this._onWindowModeChanged));
-
         let fullscreenAction = new FullscreenAction.FullscreenAction({ window: mainWindow });
         fullscreenAction.connect('notify::state', Lang.bind(this, this._onFullscreenChanged));
         this.actionGroup.add_action(fullscreenAction);
@@ -449,14 +446,6 @@ const EvinceView = new Lang.Class({
         }
     },
 
-    _onWindowModeChanged: function() {
-        let windowMode = Application.modeController.getWindowMode();
-        if (windowMode != WindowMode.WindowMode.PREVIEW_EV) {
-            this.controlsVisible = false;
-            this._hidePresentation();
-        }
-    },
-
     _onFullscreenChanged: function(action) {
         let fullscreen = action.state.get_boolean();
 
diff --git a/src/windowMode.js b/src/windowMode.js
index fcf4e4e..4051ee9 100644
--- a/src/windowMode.js
+++ b/src/windowMode.js
@@ -56,7 +56,7 @@ const ModeController = new Lang.Class({
          * provider. It is easier to special case it here instead of all
          * over the code.
          */
-        if (this._mode == WindowMode.PREVIEW_EV && oldMode == WindowMode.NONE && steps == 1)
+        if (oldMode == WindowMode.NONE && steps == 1)
           oldMode = WindowMode.DOCUMENTS;
 
         if (oldMode == WindowMode.NONE)


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