[sushi] all: use an uniform coding style



commit 346943d91f780b192be4d939a802a0d5305a286e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Apr 19 17:35:05 2012 -0400

    all: use an uniform coding style
    
    Don't use double quotes for signal and property names; fix a couple of
    missing semicolons and shadowed variables too.
    
    There's no functional change.

 src/js/ui/application.js      |    8 +++---
 src/js/ui/fallbackRenderer.js |   32 +++++++++++-----------
 src/js/ui/main.js             |    4 +-
 src/js/ui/mainWindow.js       |   56 +++++++++++++++++++-------------------
 src/js/ui/mimeHandler.js      |    2 +-
 src/js/ui/utils.js            |   16 +++++-----
 src/js/util/features.js.in    |    2 +-
 src/js/util/path.js.in        |    6 ++--
 src/js/viewers/audio.js       |   60 ++++++++++++++++++++--------------------
 src/js/viewers/evince.js      |   34 +++++++++++-----------
 src/js/viewers/folder.js      |   28 +++++++++---------
 src/js/viewers/font.js        |   10 +++---
 src/js/viewers/gst.js         |   38 +++++++++++++-------------
 src/js/viewers/html.js        |    8 +++---
 src/js/viewers/image.js       |   10 +++---
 src/js/viewers/text.js        |   22 +++++++-------
 16 files changed, 168 insertions(+), 168 deletions(-)
---
diff --git a/src/js/ui/application.js b/src/js/ui/application.js
index 8cb9910..c8afc7e 100644
--- a/src/js/ui/application.js
+++ b/src/js/ui/application.js
@@ -44,13 +44,13 @@ const _SUSHI_DBUS_PATH = '/org/gnome/NautilusPreviewer';
 const SushiIface = {
     name: 'org.gnome.NautilusPreviewer',
 
-    methods: [ { name: "Activate",
+    methods: [ { name: 'Activate',
                  inSignature: '',
                  outSignature: '' },
-               { name: "ShowFile",
+               { name: 'ShowFile',
                  inSignature: 'sib',
                  outSignature: '' },
-               { name: "Close",
+               { name: 'Close',
                  inSignature: '',
                  outSignature: '' }],
 
@@ -106,7 +106,7 @@ Application.prototype = {
 
     _defineStyleAndThemes : function() {
         let provider = new Gtk.CssProvider();
-        provider.load_from_path(Path.STYLE_DIR + "gtk-style.css");
+        provider.load_from_path(Path.STYLE_DIR + 'gtk-style.css');
         Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
                                                  provider,
                                                  600);
diff --git a/src/js/ui/fallbackRenderer.js b/src/js/ui/fallbackRenderer.js
index ca7c947..3cd897b 100644
--- a/src/js/ui/fallbackRenderer.js
+++ b/src/js/ui/fallbackRenderer.js
@@ -28,7 +28,7 @@
 let Gtk = imports.gi.Gtk;
 let Sushi = imports.gi.Sushi;
 
-let Gettext = imports.gettext.domain("sushi");
+let Gettext = imports.gettext.domain('sushi');
 let _ = Gettext.gettext;
 
 let Constants = imports.util.constants;
@@ -55,20 +55,20 @@ FallbackRenderer.prototype = {
         this._fileLoader = new Sushi.FileLoader();
         this._fileLoader.file = file;
         this._fileLoaderId =
-            this._fileLoader.connect("notify",
+            this._fileLoader.connect('notify',
                                      Lang.bind(this, this._onFileInfoChanged));
 
         this._box = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
                                   spacing: 6 });
-        this._image = new Gtk.Image({ "icon-name": "document",
-                                      "pixel-size": 256 });
+        this._image = new Gtk.Image({ icon_name: 'document',
+                                      pixel_size: 256 });
         this._box.pack_start(this._image, false, false, 0);
 
         let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
                                  spacing: 1,
-                                 "margin-top": 48,
-                                 "margin-left": 12,
-                                 "margin-right": 12 });
+                                 margin_top: 48,
+                                 margin_left: 12,
+                                 margin_right: 12 });
         this._box.pack_start(vbox, false, false, 0);
 
         let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
@@ -108,25 +108,25 @@ FallbackRenderer.prototype = {
     },
 
     _applyLabels : function() {
-        let titleStr = 
-            "<b><big>" + 
+        let titleStr =
+            '<b><big>' +
             ((this._fileLoader.name) ? (this._fileLoader.name) : (this._fileLoader.file.get_basename()))
-            + "</big></b>";
+            + '</big></b>';
 
         let typeStr =
-            "<small><b>" + _("Type") + "  </b>" +
+            '<small><b>' + _("Type") + '  </b>' +
             ((this._fileLoader.contentType) ? (this._fileLoader.contentType) : (_("Loading...")))
-             + "</small>";
+             + '</small>';
 
         let sizeStr =
-            "<small><b>" + _("Size") + "  </b>" +
+            '<small><b>' + _("Size") + '  </b>' +
             ((this._fileLoader.size) ? (this._fileLoader.size) : (_("Loading...")))
-             + "</small>";
+             + '</small>';
 
         let dateStr =
-            "<small><b>" + _("Modified") + "  </b>" +
+            '<small><b>' + _("Modified") + '  </b>' +
              ((this._fileLoader.time) ? (this._fileLoader.time) : (_("Loading...")))
-             + "</small>";
+             + '</small>';
 
         this._titleLabel.set_markup(titleStr);
         this._typeLabel.set_markup(typeStr);
diff --git a/src/js/ui/main.js b/src/js/ui/main.js
index 5080366..3298d72 100644
--- a/src/js/ui/main.js
+++ b/src/js/ui/main.js
@@ -37,10 +37,10 @@ const Utils = imports.ui.utils;
 const Tweener = imports.ui.tweener;
 
 function run() {
-    Gettext.bindtextdomain("sushi", Path.LOCALE_DIR);
+    Gettext.bindtextdomain('sushi', Path.LOCALE_DIR);
     String.prototype.format = Format.format;
 
-    GLib.set_application_name("Sushi");
+    GLib.set_application_name('Sushi');
 
     let application = new Application.Application();
 
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index e18a5dd..c406098 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -90,9 +90,9 @@ MainWindow.prototype = {
         let screen = Gdk.Screen.get_default();
         this._gtkWindow.set_visual(screen.get_rgba_visual());
 
-        this._gtkWindow.connect("delete-event",
+        this._gtkWindow.connect('delete-event',
                                 Lang.bind(this, this._onWindowDeleteEvent));
-        this._gtkWindow.connect("realize", Lang.bind(this,
+        this._gtkWindow.connect('realize', Lang.bind(this,
             function() {
                 // don't support maximize and minimize
                 this._gtkWindow.get_window().set_functions(Gdk.WMFunction.MOVE |
@@ -121,11 +121,11 @@ MainWindow.prototype = {
     },
 
     _connectStageSignals : function() {
-        this._stage.connect("key-press-event",
+        this._stage.connect('key-press-event',
                             Lang.bind(this, this._onStageKeyPressEvent));
-        this._stage.connect("button-press-event",
+        this._stage.connect('button-press-event',
                             Lang.bind(this, this._onButtonPressEvent));
-        this._stage.connect("motion-event",
+        this._stage.connect('motion-event',
                             Lang.bind(this, this._onMotionEvent));
     },
 
@@ -210,7 +210,7 @@ MainWindow.prototype = {
             return false;
         }
 
-        let root_coords = 
+        let root_coords =
             this._gtkWindow.get_window().get_root_coords(win_coords[0],
                                                          win_coords[1]);
 
@@ -273,7 +273,7 @@ MainWindow.prototype = {
         }
 
         if (yFactor == 0) {
-            if (this._isFullScreen && 
+            if (this._isFullScreen &&
                (textureSize[0] > textureSize[1]))
                 yFactor = 0.52;
             else
@@ -310,7 +310,7 @@ MainWindow.prototype = {
         this._renderer.startTimeout();
 
         file.query_info_async
-        (Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME + "," +
+        (Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME + ',' +
          Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
          Gio.FileQueryInfoFlags.NONE,
          GLib.PRIORITY_DEFAULT, null,
@@ -348,13 +348,13 @@ MainWindow.prototype = {
 
         this._texture = this._renderer.render();
 
-        this._textureXAlign = 
+        this._textureXAlign =
             new Clutter.AlignConstraint({ source: this._stage,
                                           factor: 0.5 });
         this._textureYAlign =
             new Clutter.AlignConstraint({ source: this._stage,
                                           factor: 0.5,
-                                          "align-axis": Clutter.AlignAxis.Y_AXIS })
+                                          align_axis: Clutter.AlignAxis.Y_AXIS });
 
         this._texture.add_constraint(this._textureXAlign);
         this._texture.add_constraint(this._textureYAlign);
@@ -384,12 +384,12 @@ MainWindow.prototype = {
         Tweener.addTween(this._mainGroup,
                          { opacity: 255,
                            time: 0.15,
-                           transition: 'easeOutQuad',
+                           transition: 'easeOutQuad'
                          });
         Tweener.addTween(this._titleGroup,
                          { opacity: 255,
                            time: 0.15,
-                           transition: 'easeOutQuad',
+                           transition: 'easeOutQuad'
                          });
     },
 
@@ -401,11 +401,11 @@ MainWindow.prototype = {
             this._removeToolbarTimeout();
         }
 
-        /* wait for the next stage allocation to fade in the texture 
+        /* wait for the next stage allocation to fade in the texture
          * and background again.
          */
         this._unFullScreenId =
-            this._stage.connect("notify::allocation",
+            this._stage.connect('notify::allocation',
                                 Lang.bind(this, this._onStageUnFullScreen));
 
         /* quickly fade out everything,
@@ -472,11 +472,11 @@ MainWindow.prototype = {
             this._removeToolbarTimeout();
         }
 
-        /* wait for the next stage allocation to fade in the texture 
+        /* wait for the next stage allocation to fade in the texture
          * and background again.
          */
         this._fullScreenId =
-            this._stage.connect("notify::allocation",
+            this._stage.connect('notify::allocation',
                                 Lang.bind(this, this._onStageFullScreen));
 
         /* quickly fade out everything,
@@ -522,13 +522,13 @@ MainWindow.prototype = {
             new Clutter.AlignConstraint({ source: this._stage,
                                           factor: 0.5 }));
 
-        let yConstraint = 
+        let yConstraint =
             new Clutter.BindConstraint({ source: this._stage,
                                          coordinate: Clutter.BindCoordinate.Y,
                                          offset: this._stage.height - Constants.TOOLBAR_SPACING });
         this._toolbarActor.add_constraint(yConstraint);
 
-        this._stage.connect("notify::height",
+        this._stage.connect('notify::height',
                             Lang.bind(this, function() {
                                 yConstraint.set_offset(this._stage.height - Constants.TOOLBAR_SPACING);
                             }));
@@ -551,7 +551,7 @@ MainWindow.prototype = {
             Tweener.addTween(this._toolbarActor,
                              { opacity: 200,
                                time: 0.1,
-                               transition: 'easeOutQuad',
+                               transition: 'easeOutQuad'
                              });
         }
 
@@ -594,21 +594,21 @@ MainWindow.prototype = {
         if (!this._clientDecorated)
             return;
 
-        this._titleLabel = new Gtk.Label({ label: "",
+        this._titleLabel = new Gtk.Label({ label: '',
 					   ellipsize: Pango.EllipsizeMode.END,
                                            margin: 6 });
-        this._titleLabel.get_style_context().add_class("np-decoration");
-        
+        this._titleLabel.get_style_context().add_class('np-decoration');
+
         this._titleLabel.show();
         this._titleActor = new GtkClutter.Actor({ contents: this._titleLabel });
 
-        this._quitButton = 
-            new Gtk.Button({ image: new Gtk.Image ({ "icon-size": Gtk.IconSize.MENU,
-                                                     "icon-name": "window-close-symbolic" })});
-        this._quitButton.get_style_context().add_class("np-decoration");
+        this._quitButton =
+            new Gtk.Button({ image: new Gtk.Image ({ icon_size: Gtk.IconSize.MENU,
+                                                     icon_name: 'window-close-symbolic' })});
+        this._quitButton.get_style_context().add_class('np-decoration');
         this._quitButton.show();
 
-        this._quitButton.connect("clicked",
+        this._quitButton.connect('clicked',
                                  Lang.bind(this,
                                            this._clearAndQuit));
 
@@ -652,7 +652,7 @@ MainWindow.prototype = {
         Tweener.addTween(this._titleGroup,
                          { opacity: 0,
                            time: 0.15,
-                           transition: 'easeOutQuad',
+                           transition: 'easeOutQuad'
                          });
 
         Tweener.addTween(this._mainGroup,
diff --git a/src/js/ui/mimeHandler.js b/src/js/ui/mimeHandler.js
index 405b93b..701eb85 100644
--- a/src/js/ui/mimeHandler.js
+++ b/src/js/ui/mimeHandler.js
@@ -54,7 +54,7 @@ MimeHandler.prototype = {
     registerMime: function(mime, obj) {
         this._mimeTypes[mime] = obj;
 
-        log ("Register mimetype " + mime);
+        log ('Register mimetype ' + mime);
     },
 
     registerMimeTypes: function(mimeTypes, obj) {
diff --git a/src/js/ui/utils.js b/src/js/ui/utils.js
index 8000327..10a9a9e 100644
--- a/src/js/ui/utils.js
+++ b/src/js/ui/utils.js
@@ -94,21 +94,21 @@ function getStaticSize(renderer, widget) {
 
 function createToolButton(iconName, callback) {
     let button = new Gtk.ToolButton({ expand: false,
-                                      "icon-name": iconName });
+                                      icon_name: iconName });
     button.show();
-    button.connect("clicked", callback);
+    button.connect('clicked', callback);
 
     return button;
 }
 
 function createFullScreenButton(mainWindow) {
-    return createToolButton("view-fullscreen-symbolic", Lang.bind(this, function() {
+    return createToolButton('view-fullscreen-symbolic', Lang.bind(this, function() {
         mainWindow.toggleFullScreen();
-    }));        
+    }));
 }
 
 function createOpenButton(file, mainWindow) {
-    return createToolButton("document-open-symbolic", Lang.bind(this, function(widget) {
+    return createToolButton('document-open-symbolic', Lang.bind(this, function(widget) {
         let timestamp = Gtk.get_current_event_time();
         try {
             Gtk.show_uri(widget.get_screen(),
@@ -117,7 +117,7 @@ function createOpenButton(file, mainWindow) {
 
             mainWindow.close();
         } catch (e) {
-            log('Unable to execute the default application for ' + 
+            log('Unable to execute the default application for ' +
                 file.get_uri() + ' : ' + e.toString());
         }
     }));
@@ -132,9 +132,9 @@ function formatTimeString(timeVal) {
 
     let seconds = Math.floor(timeVal);
 
-    let str = ("%02d:%02d").format(minutes, seconds);
+    let str = ('%02d:%02d').format(minutes, seconds);
     if (hours > 0) {
-        str = ("%d").format(hours) + ":" + str;
+        str = ('%d').format(hours) + ':' + str;
     }
 
     return str;
diff --git a/src/js/util/features.js.in b/src/js/util/features.js.in
index 8e4a6a6..bf90233 100644
--- a/src/js/util/features.js.in
+++ b/src/js/util/features.js.in
@@ -25,4 +25,4 @@
  *
  */
 
-let HAVE_UNOCONV = @have_unoconv@
\ No newline at end of file
+let HAVE_UNOCONV = @have_unoconv@;
\ No newline at end of file
diff --git a/src/js/util/path.js.in b/src/js/util/path.js.in
index 21fd9fc..d3332d4 100644
--- a/src/js/util/path.js.in
+++ b/src/js/util/path.js.in
@@ -25,6 +25,6 @@
  *
  */
 
-let LOCALE_DIR = "@localedir@";
-let ICONS_DIR = "@pkgdatadir@/icons/";
-let STYLE_DIR = "@pkgdatadir@/style/";
\ No newline at end of file
+let LOCALE_DIR = '@localedir@';
+let ICONS_DIR = '@pkgdatadir@/icons/';
+let STYLE_DIR = '@pkgdatadir@/style/';
\ No newline at end of file
diff --git a/src/js/viewers/audio.js b/src/js/viewers/audio.js
index c4a26fd..2b304ef 100644
--- a/src/js/viewers/audio.js
+++ b/src/js/viewers/audio.js
@@ -29,7 +29,7 @@ let MimeHandler = imports.ui.mimeHandler;
 let Gst = imports.gi.Gst;
 let Gio = imports.gi.Gio;
 
-let Gettext = imports.gettext.domain("sushi");
+let Gettext = imports.gettext.domain('sushi');
 let _ = Gettext.gettext;
 
 let Constants = imports.util.constants;
@@ -56,15 +56,15 @@ AudioRenderer.prototype = {
 
         this._box = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
                                   spacing: 6 });
-        this._image = new Gtk.Image({ "icon-name": "media-optical-symbolic",
-                                      "pixel-size": 256 });
+        this._image = new Gtk.Image({ icon_name: 'media-optical-symbolic',
+                                      pixel_size: 256 });
         this._box.pack_start(this._image, false, false, 0);
 
         let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
                                  spacing: 1,
-                                 "margin-top": 48,
-                                 "margin-left": 12,
-                                 "margin-right": 12 });
+                                 margin_top: 48,
+                                 margin_left: 12,
+                                 margin_right: 12 });
         this._box.pack_start(vbox, false, false, 0);
 
         this._titleLabel = new Gtk.Label();
@@ -96,19 +96,19 @@ AudioRenderer.prototype = {
         this._player.playing = true;
 
         this._playerNotifies.push(
-            this._player.connect("notify::progress",
+            this._player.connect('notify::progress',
                                  Lang.bind(this, this._onPlayerProgressChanged)));
         this._playerNotifies.push(
-            this._player.connect("notify::duration",
+            this._player.connect('notify::duration',
                                  Lang.bind(this, this._onPlayerDurationChanged)));
         this._playerNotifies.push(
-            this._player.connect("notify::state",
+            this._player.connect('notify::state',
                                  Lang.bind(this, this._onPlayerStateChanged)));
         this._playerNotifies.push(
-            this._player.connect("notify::taglist",
+            this._player.connect('notify::taglist',
                                  Lang.bind(this, this._onTagListChanged)));
         this._playerNotifies.push(
-            this._player.connect("notify::cover",
+            this._player.connect('notify::cover',
                                  Lang.bind(this, this._onCoverArtChanged)));
     },
 
@@ -147,7 +147,7 @@ AudioRenderer.prototype = {
 
     _onCoverArtChanged : function() {
         if (!this._artFetcher.cover) {
-            this._image.set_from_icon_name("media-optical-symbolic");
+            this._image.set_from_icon_name('media-optical-symbolic');
             return;
         }
 
@@ -157,9 +157,9 @@ AudioRenderer.prototype = {
 
     _onTagListChanged : function() {
         let tags = this._player.taglist;
-        let albumName = tags.get_string("album")[1];
-        let artistName = tags.get_string("artist")[1];
-        let titleName = tags.get_string("title")[1];
+        let albumName = tags.get_string('album')[1];
+        let artistName = tags.get_string('artist')[1];
+        let titleName = tags.get_string('title')[1];
         let haveTitleTag = true;
 
         if (!titleName) {
@@ -169,23 +169,23 @@ AudioRenderer.prototype = {
         }
 
         if (albumName)
-            this._albumLabel.set_markup("<small><i>" + _("from") + "  </i>" + albumName + "</small>");
+            this._albumLabel.set_markup('<small><i>' + _("from") + '  </i>' + albumName + '</small>');
         if (artistName)
-            this._authorLabel.set_markup("<small><i>" + _("by") + "  </i><b>" + artistName + "</b></small>");
+            this._authorLabel.set_markup('<small><i>' + _("by") + '  </i><b>' + artistName + '</b></small>');
 
-        this._titleLabel.set_markup("<b>" + titleName + "</b>");
+        this._titleLabel.set_markup('<b>' + titleName + '</b>');
 
-        let windowTitle = "";
+        let windowTitle = '';
 
         if (artistName && haveTitleTag)
-            windowTitle = artistName + " - " + titleName;
+            windowTitle = artistName + ' - ' + titleName;
         else
             windowTitle = titleName;
 
         this._mainWindow.setTitle(windowTitle);
 
         this._artFetcher = new Sushi.CoverArtFetcher();
-        this._artFetcher.connect("notify::cover",
+        this._artFetcher.connect('notify::cover',
                                  Lang.bind(this, this._onCoverArtChanged));
 
         this._artFetcher.taglist = tags;
@@ -233,10 +233,10 @@ AudioRenderer.prototype = {
     _onPlayerStateChanged : function() {
         switch(this._player.state) {
         case Sushi.SoundPlayerState.PLAYING:
-            this._toolbarPlay.set_icon_name("media-playback-pause-symbolic");
+            this._toolbarPlay.set_icon_name('media-playback-pause-symbolic');
             break;
         default:
-            this._toolbarPlay.set_icon_name("media-playback-start-symbolic");
+            this._toolbarPlay.set_icon_name('media-playback-start-symbolic');
         }
     },
 
@@ -255,7 +255,7 @@ AudioRenderer.prototype = {
 
     createToolbar : function () {
         this._mainToolbar = new Gtk.Toolbar();
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.set_icon_size(Gtk.IconSize.MENU);
         this._mainToolbar.show();
 
@@ -266,18 +266,18 @@ AudioRenderer.prototype = {
                                          coordinate: Clutter.BindCoordinate.WIDTH,
                                          offset: -50 }));
 
-        this._toolbarPlay = new Gtk.ToolButton({ "icon-name": "media-playback-pause-symbolic" });
+        this._toolbarPlay = new Gtk.ToolButton({ icon_name: 'media-playback-pause-symbolic' });
         this._toolbarPlay.show();
         this._mainToolbar.insert(this._toolbarPlay, 0);
 
-        this._currentLabel = new Gtk.Label({ "margin-left": 6,
-                                             "margin-right": 3 });
+        this._currentLabel = new Gtk.Label({ margin_left: 6,
+                                             margin_right: 3 });
         let item = new Gtk.ToolItem();
         item.add(this._currentLabel);
         item.show_all();
         this._mainToolbar.insert(item, 1);
 
-        this._toolbarPlay.connect("clicked",
+        this._toolbarPlay.connect('clicked',
                                   Lang.bind(this, function () {
                                       let playing = !this._player.playing;
                                       this._player.playing = playing;
@@ -288,7 +288,7 @@ AudioRenderer.prototype = {
                                      0, 1000, 10);
         this._progressBar.set_value(0);
         this._progressBar.set_draw_value(false);
-        this._progressBar.connect("value-changed",
+        this._progressBar.connect('value-changed',
                                   Lang.bind(this, function() {
                                       if(!this._isSettingValue)
                                           this._player.progress = this._progressBar.get_value() / 1000;
@@ -300,7 +300,7 @@ AudioRenderer.prototype = {
         item.show_all();
         this._mainToolbar.insert(item, 2);
 
-        this._durationLabel = new Gtk.Label({ "margin-left": 3 });
+        this._durationLabel = new Gtk.Label({ margin_left: 3 });
         item = new Gtk.ToolItem();
         item.add(this._durationLabel);
         item.show_all();
diff --git a/src/js/viewers/evince.js b/src/js/viewers/evince.js
index 1cf5b1f..a415b61 100644
--- a/src/js/viewers/evince.js
+++ b/src/js/viewers/evince.js
@@ -31,7 +31,7 @@ let EvView = imports.gi.EvinceView;
 
 let Sushi = imports.gi.Sushi;
 
-let Gettext = imports.gettext.domain("sushi");
+let Gettext = imports.gettext.domain('sushi');
 let _ = Gettext.gettext;
 
 let Utils = imports.ui.utils;
@@ -58,7 +58,7 @@ EvinceRenderer.prototype = {
         this._callback = callback;
 
         this._pdfLoader = new Sushi.PdfLoader();
-        this._pdfLoader.connect("notify::document",
+        this._pdfLoader.connect('notify::document',
                                 Lang.bind(this, this._onDocumentLoaded));
         this._pdfLoader.uri = file.get_uri();
     },
@@ -75,7 +75,7 @@ EvinceRenderer.prototype = {
 
         this._toolbarBack.set_sensitive(curPage > 0);
         this._toolbarForward.set_sensitive(curPage < totPages - 1);
-        
+
         this._pageLabel.set_text(_("%d of %d").format(curPage + 1, totPages));
     },
 
@@ -86,7 +86,7 @@ EvinceRenderer.prototype = {
         this._model.set_sizing_mode(EvView.SizingMode.FIT_WIDTH);
 	this._model.set_continuous(true);
 
-        this._model.connect("page-changed",
+        this._model.connect('page-changed',
                             Lang.bind(this, function() {
                                 this._updatePageLabel();
                             }));
@@ -127,19 +127,19 @@ EvinceRenderer.prototype = {
     },
 
     createToolbar : function() {
-        this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.MENU });
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.set_show_arrow(false);
         this._mainToolbar.show();
 
         this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar });
 
         this._toolbarBack = new Gtk.ToolButton({ expand: false,
-                                                 "icon-name": "go-previous-symbolic" });
+                                                 icon_name: 'go-previous-symbolic' });
         this._toolbarBack.show();
         this._mainToolbar.insert(this._toolbarBack, -1);
 
-        this._toolbarBack.connect("clicked",
+        this._toolbarBack.connect('clicked',
                                   Lang.bind(this, function () {
                                       this._view.previous_page();
                                   }));
@@ -148,11 +148,11 @@ EvinceRenderer.prototype = {
         this._mainToolbar.insert(labelItem, -1);
 
         this._toolbarForward = new Gtk.ToolButton({ expand: false,
-                                                 "icon-name": "go-next-symbolic" });
+                                                    icon_name: 'go-next-symbolic' });
         this._toolbarForward.show();
         this._mainToolbar.insert(this._toolbarForward, -1);
 
-        this._toolbarForward.connect("clicked",
+        this._toolbarForward.connect('clicked',
                                      Lang.bind(this, function () {
                                          this._view.next_page();
                                      }));
@@ -184,13 +184,13 @@ handler.registerMimeTypes(mimeTypes, renderer);
 
 if (Features.HAVE_UNOCONV) {
     let officeTypes = [
-        "application/vnd.oasis.opendocument.text",
-        "application/vnd.oasis.opendocument.presentation",
-        "application/vnd.oasis.opendocument.spreadsheet",
-        "application/msword",
-        "application/vnd.ms-excel",
-        "application/vnd.ms-powerpoint",
-        "application/rtf"
+        'application/vnd.oasis.opendocument.text',
+        'application/vnd.oasis.opendocument.presentation',
+        'application/vnd.oasis.opendocument.spreadsheet',
+        'application/msword',
+        'application/vnd.ms-excel',
+        'application/vnd.ms-powerpoint',
+        'application/rtf'
     ];
 
     handler.registerMimeTypes(officeTypes, renderer);
diff --git a/src/js/viewers/folder.js b/src/js/viewers/folder.js
index 12da8fc..7e73942 100644
--- a/src/js/viewers/folder.js
+++ b/src/js/viewers/folder.js
@@ -29,7 +29,7 @@ let MimeHandler = imports.ui.mimeHandler;
 let Gtk = imports.gi.Gtk;
 let Sushi = imports.gi.Sushi;
 
-let Gettext = imports.gettext.domain("sushi");
+let Gettext = imports.gettext.domain('sushi');
 let _ = Gettext.gettext;
 
 let Constants = imports.util.constants;
@@ -59,20 +59,20 @@ FolderRenderer.prototype = {
         this._folderLoader = new Sushi.FileLoader();
         this._folderLoader.file = file;
         this._folderLoaderId =
-            this._folderLoader.connect("notify",
+            this._folderLoader.connect('notify',
                                        Lang.bind(this, this._onFolderInfoChanged));
 
         this._box = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
                                   spacing: 6 });
-        this._image = new Gtk.Image({ "icon-name": "folder",
-                                      "pixel-size": 256 });
+        this._image = new Gtk.Image({ icon_name: 'folder',
+                                      pixel_size: 256 });
         this._box.pack_start(this._image, false, false, 0);
 
         let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
                                  spacing: 1,
-                                 "margin-top": 48,
-                                 "margin-left": 12,
-                                 "margin-right": 12 });
+                                 margin_top: 48,
+                                 margin_left: 12,
+                                 margin_right: 12 });
         this._box.pack_start(vbox, false, false, 0);
 
         let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
@@ -113,21 +113,21 @@ FolderRenderer.prototype = {
 	    try {
 		name = this._folderLoader.file.get_basename();
 	    } catch (e) {
-		name = "";
+		name = '';
 	    }
 	}
         let titleStr =
-            "<b><big>" + name + "</big></b>";
+            '<b><big>' + name + '</big></b>';
 
         let sizeStr =
-            "<small><b>" + _("Size") + "  </b>" +
+            '<small><b>' + _("Size") + '  </b>' +
             ((this._folderLoader.size) ? (this._folderLoader.size) : (_("Loading...")))
-             + "</small>";
+             + '</small>';
 
         let dateStr =
-            "<small><b>" + _("Modified") + "  </b>" +
+            '<small><b>' + _("Modified") + '  </b>' +
              ((this._folderLoader.time) ? (this._folderLoader.time) : (_("Loading...")))
-             + "</small>";
+             + '</small>';
 
         this._titleLabel.set_markup(titleStr);
         this._sizeLabel.set_markup(sizeStr);
@@ -163,4 +163,4 @@ FolderRenderer.prototype = {
 let handler = new MimeHandler.MimeHandler();
 let renderer = new FolderRenderer();
 
-handler.registerMime("inode/directory", renderer);
+handler.registerMime('inode/directory', renderer);
diff --git a/src/js/viewers/font.js b/src/js/viewers/font.js
index c654e10..7c60fb5 100644
--- a/src/js/viewers/font.js
+++ b/src/js/viewers/font.js
@@ -49,7 +49,7 @@ FontRenderer.prototype = {
 
         this._fontWidget = new Sushi.FontWidget({ uri: file.get_uri() });
         this._fontWidget.show();
-        this._fontWidget.connect("loaded",
+        this._fontWidget.connect('loaded',
                                  Lang.bind(this, this._onFontLoaded));
 
         this._fontActor = new GtkClutter.Actor({ contents: this._fontWidget });
@@ -81,10 +81,10 @@ let handler = new MimeHandler.MimeHandler();
 let renderer = new FontRenderer();
 
 let mimeTypes = [
-    "application/x-font-ttf",
-    "application/x-font-otf",
-    "application/x-font-pcf",
-    "application/x-font-type1"
+    'application/x-font-ttf',
+    'application/x-font-otf',
+    'application/x-font-pcf',
+    'application/x-font-type1'
 ];
 
 handler.registerMimeTypes(mimeTypes, renderer);
diff --git a/src/js/viewers/gst.js b/src/js/viewers/gst.js
index 9b31111..77a73f9 100644
--- a/src/js/viewers/gst.js
+++ b/src/js/viewers/gst.js
@@ -66,22 +66,22 @@ GstRenderer.prototype = {
 
     _createVideo : function(file) {
         this._video =
-            new ClutterGst.VideoTexture({ "sync-size": false });
+            new ClutterGst.VideoTexture({ sync_size: false });
 
         this._video.set_uri(file.get_uri());
         this._video.playing = true;
 
         this._videoSizeChangeId =
-            this._video.connect("size-change",
+            this._video.connect('size-change',
                                 Lang.bind(this,
                                           this._onVideoSizeChange));
-        this._video.connect("notify::playing",
+        this._video.connect('notify::playing',
                             Lang.bind(this,
-                                      this._onVideoPlayingChange))
-        this._video.connect("notify::progress",
+                                      this._onVideoPlayingChange));
+        this._video.connect('notify::progress',
                             Lang.bind(this,
                                       this._onVideoProgressChange));
-        this._video.connect("notify::duration",
+        this._video.connect('notify::duration',
                             Lang.bind(this,
                                       this._onVideoDurationChange));
     },
@@ -125,9 +125,9 @@ GstRenderer.prototype = {
 
     _onVideoPlayingChange : function() {
         if (this._video.playing)
-            this._toolbarPlay.set_icon_name("media-playback-pause-symbolic");
+            this._toolbarPlay.set_icon_name('media-playback-pause-symbolic');
         else
-            this._toolbarPlay.set_icon_name("media-playback-start-symbolic");
+            this._toolbarPlay.set_icon_name('media-playback-start-symbolic');
     },
 
     getSizeForAllocation : function(allocation) {
@@ -142,8 +142,8 @@ GstRenderer.prototype = {
     },
 
     createToolbar : function () {
-        this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.MENU });
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.show();
 
         this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar,
@@ -153,18 +153,18 @@ GstRenderer.prototype = {
                                          coordinate: Clutter.BindCoordinate.WIDTH,
                                          offset: -50 }));
 
-        this._toolbarPlay = new Gtk.ToolButton({ "icon-name": "media-playback-pause-symbolic" });
+        this._toolbarPlay = new Gtk.ToolButton({ icon_name: 'media-playback-pause-symbolic' });
         this._toolbarPlay.show();
         this._mainToolbar.insert(this._toolbarPlay, 0);
 
-        this._currentLabel = new Gtk.Label({ "margin-left": 6,
-                                             "margin-right": 3 });
+        this._currentLabel = new Gtk.Label({ margin_left: 6,
+                                             margin_right: 3 });
         let item = new Gtk.ToolItem();
         item.add(this._currentLabel);
         item.show_all();
         this._mainToolbar.insert(item, 1);
 
-        this._toolbarPlay.connect("clicked",
+        this._toolbarPlay.connect('clicked',
                                   Lang.bind(this, function () {
                                       let playing = !this._video.playing;
                                       this._video.playing = playing;
@@ -175,21 +175,21 @@ GstRenderer.prototype = {
                                      0, 1000, 10);
         this._progressBar.set_value(0);
         this._progressBar.set_draw_value(false);
-        this._progressBar.connect("value-changed",
+        this._progressBar.connect('value-changed',
                                   Lang.bind(this, function() {
                                       if(!this._isSettingValue)
                                           this._video.progress = this._progressBar.get_value() / 1000;
                                   }));
 
-        let item = new Gtk.ToolItem();
+        item = new Gtk.ToolItem();
         item.set_expand(true);
         item.add(this._progressBar);
         item.show_all();
         this._mainToolbar.insert(item, 2);
 
-        this._durationLabel = new Gtk.Label({ "margin-left": 3,
-                                              "margin-right": 6 });
-        let item = new Gtk.ToolItem();
+        this._durationLabel = new Gtk.Label({ margin_left: 3,
+                                              margin_right: 6 });
+        item = new Gtk.ToolItem();
         item.add(this._durationLabel);
         item.show_all();
         this._mainToolbar.insert(item, 3);
diff --git a/src/js/viewers/html.js b/src/js/viewers/html.js
index 71c5bdd..29fa92b 100644
--- a/src/js/viewers/html.js
+++ b/src/js/viewers/html.js
@@ -57,7 +57,7 @@ HTMLRenderer.prototype = {
 
         /* disable the default context menu of the web view */
         let settings = this._webView.settings;
-        settings["enable-default-context-menu"] = false;
+        settings.enable_default_context_menu = false;
 
         this._webView.load_uri(file.get_uri());
 
@@ -76,8 +76,8 @@ HTMLRenderer.prototype = {
     },
 
     createToolbar : function() {
-        this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.MENU });
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.set_show_arrow(false);
         this._mainToolbar.show();
 
@@ -101,7 +101,7 @@ let handler = new MimeHandler.MimeHandler();
 let renderer = new HTMLRenderer();
 
 let mimeTypes = [
-    "text/html",
+    'text/html'
 ];
 
 handler.registerMimeTypes(mimeTypes, renderer);
diff --git a/src/js/viewers/image.js b/src/js/viewers/image.js
index 5526d83..b1f4a16 100644
--- a/src/js/viewers/image.js
+++ b/src/js/viewers/image.js
@@ -31,7 +31,7 @@ let GtkClutter = imports.gi.GtkClutter;
 let Gtk = imports.gi.Gtk;
 let GLib = imports.gi.GLib;
 
-let Gettext = imports.gettext.domain("sushi");
+let Gettext = imports.gettext.domain('sushi');
 let _ = Gettext.gettext;
 
 let Utils = imports.ui.utils;
@@ -77,7 +77,7 @@ ImageRenderer.prototype = {
          Lang.bind(this, function(obj, res) {
              let pix = GdkPixbuf.Pixbuf.new_from_stream_finish(res);
 
-             this._texture = new GtkClutter.Texture({ "keep-aspect-ratio": true });
+             this._texture = new GtkClutter.Texture({ keep_aspect_ratio: true });
              this._texture.set_from_pixbuf(pix);
 
              /* we're ready now */
@@ -88,7 +88,7 @@ ImageRenderer.prototype = {
                                     try {
                                         object.close_finish(res);
                                     } catch (e) {
-                                        log("Unable to close the stream " + e.toString());
+                                        log('Unable to close the stream ' + e.toString());
                                     }
                                 });
          }));
@@ -100,8 +100,8 @@ ImageRenderer.prototype = {
     },
 
     createToolbar : function() {
-        this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.MENU });
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.set_show_arrow(false);
         this._mainToolbar.show();
 
diff --git a/src/js/viewers/text.js b/src/js/viewers/text.js
index 9e6bbd6..ea0cc0a 100644
--- a/src/js/viewers/text.js
+++ b/src/js/viewers/text.js
@@ -52,17 +52,17 @@ TextRenderer.prototype = {
         this._callback = callback;
 
         this._textLoader = new Sushi.TextLoader();
-        this._textLoader.connect("loaded",
+        this._textLoader.connect('loaded',
                                  Lang.bind(this, this._onBufferLoaded));
         this._textLoader.uri = file.get_uri();
 
-        this._geditScheme = "tango";
-        let schemaName = "org.gnome.gedit.preferences.editor";
+        this._geditScheme = 'tango';
+        let schemaName = 'org.gnome.gedit.preferences.editor';
         let installedSchemas = Gio.Settings.list_schemas();
         if (installedSchemas.indexOf(schemaName) > -1) {
             let geditSettings = new Gio.Settings({ schema: schema_name });
             let geditSchemeName = geditSettings.get_string('scheme');
-            if (geditSchemeName != '') 
+            if (geditSchemeName != '')
                 this._geditScheme = geditSchemeName;
         }
 
@@ -74,7 +74,7 @@ TextRenderer.prototype = {
 
     _onBufferLoaded : function(loader, buffer) {
         this._buffer = buffer;
-        this._buffer["highlight-syntax"] = true;
+        this._buffer.highlight_syntax = true;
 
         let styleManager = GtkSource.StyleSchemeManager.get_default();
         let scheme = styleManager.get_scheme(this._geditScheme);
@@ -82,7 +82,7 @@ TextRenderer.prototype = {
 
         this._view = new GtkSource.View({ buffer: this._buffer,
                                           editable: false,
-                                          "cursor-visible": false });
+                                          cursor_visible: false });
         this._view.set_can_focus(false);
 
         if (this._buffer.get_language())
@@ -91,14 +91,14 @@ TextRenderer.prototype = {
         // FIXME: *very* ugly wokaround to the fact that we can't
         // access event.button from a button-press callback to block
         // right click
-        this._view.connect("populate-popup",
+        this._view.connect('populate-popup',
                            Lang.bind(this, function(widget, menu) {
                                menu.destroy();
                            }));
 
         this._scrolledWin = Gtk.ScrolledWindow.new(null, null);
         this._scrolledWin.add(this._view);
-        this._scrolledWin.show_all();    
+        this._scrolledWin.show_all();
 
         this._actor = new GtkClutter.Actor({ contents: this._scrolledWin });
         this._actor.set_reactive(true);
@@ -110,8 +110,8 @@ TextRenderer.prototype = {
     },
 
     createToolbar : function() {
-        this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
-        this._mainToolbar.get_style_context().add_class("np-toolbar");
+        this._mainToolbar = new Gtk.Toolbar({ icon_size: Gtk.IconSize.MENU });
+        this._mainToolbar.get_style_context().add_class('np-toolbar');
         this._mainToolbar.set_show_arrow(false);
 
         this._toolbarRun = Utils.createOpenButton(this._file, this._mainWindow);
@@ -132,7 +132,7 @@ let renderer = new TextRenderer();
  * for child types.
  */
 let mimeTypes = [
-    "text/plain",
+    'text/plain'
 ];
 
 handler.registerMimeTypes(mimeTypes, renderer);



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