[sushi] mainwindow: check if createToolbar() is implemented in the renderer



commit 69313b175b5f050422030bb9376760eba6aca654
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon May 9 17:45:25 2011 -0400

    mainwindow: check if createToolbar() is implemented in the renderer
    
    So renderers can avoid implementing an empty stub.

 src/js/ui/mainWindow.js  |    3 ++-
 src/js/viewers/folder.js |    4 ----
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 448c419..34c1e55 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -414,7 +414,8 @@ MainWindow.prototype = {
             delete this._toolbarActor;
         }
 
-        this._toolbarActor = this._renderer.createToolbar();
+        if (this._renderer.createToolbar)
+            this._toolbarActor = this._renderer.createToolbar();
 
         if (!this._toolbarActor)
             return;
diff --git a/src/js/viewers/folder.js b/src/js/viewers/folder.js
index 82bc30e..61182e8 100644
--- a/src/js/viewers/folder.js
+++ b/src/js/viewers/folder.js
@@ -113,10 +113,6 @@ FolderRenderer.prototype = {
         this._mainWindow.refreshSize();
     },
 
-    createToolbar : function() {
-        return null;
-    },
-
     clear : function() {
         this._folderLoader.stop();
         delete this._folderLoader;



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