[gnome-boxes] More coding-style fixes



commit e4b7687c282ecfd2062c62402cd2c59a6a378c2c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Oct 5 16:15:54 2011 +0300

    More coding-style fixes

 src/box.vala             |   10 +++-------
 src/boxes.vala           |   14 +++++++-------
 src/collection-view.vala |    4 ++--
 src/sidebar.vala         |    2 +-
 src/topbar.vala          |    6 +++---
 src/util.vala            |    2 +-
 6 files changed, 17 insertions(+), 21 deletions(-)
---
diff --git a/src/box.vala b/src/box.vala
index 41a7bad..3fcc5ce 100644
--- a/src/box.vala
+++ b/src/box.vala
@@ -19,7 +19,7 @@ private abstract class Boxes.Display: GLib.Object {
         displays = new HashTable<int, Gtk.Widget> (direct_hash, direct_equal);
     }
 
-    ~Boxes() {
+    ~Boxes () {
         disconnect_it ();
     }
 }
@@ -267,12 +267,8 @@ private class Boxes.BoxActor: Boxes.UI {
         actor_remove (screenshot);
 
         this.display = display;
-        width_req_id = display.notify["width-request"].connect ( (pspec) => {
-            update_display_size ();
-        });
-        height_req_id = display.notify["height-request"].connect ( (pspec) => {
-            update_display_size ();
-        });
+        width_req_id = display.notify["width-request"].connect ((pspec) => { update_display_size (); });
+        height_req_id = display.notify["height-request"].connect ((pspec) => { update_display_size (); });
         vbox.add (display);
         update_display_size ();
 
diff --git a/src/boxes.vala b/src/boxes.vala
index 7917f2a..c5acabc 100644
--- a/src/boxes.vala
+++ b/src/boxes.vala
@@ -66,11 +66,11 @@ private class Boxes.App: Boxes.UI {
         Gtk.main ();
     }
 
-    public App() {
+    public App () {
         setup_ui ();
         collection = new Collection ();
 
-        collection.item_added.connect((item) => {
+        collection.item_added.connect ((item) => {
             if (item is Box) {
                 var box = item as Box;
                 var actor = box.get_clutter_actor ();
@@ -121,7 +121,7 @@ private class Boxes.App: Boxes.UI {
 
         window.destroy.connect (quit);
         window.key_press_event.connect (on_key_pressed);
-        window.configure_event.connect ( (event) => {
+        window.configure_event.connect ((event) => {
             if (event.type == Gdk.EventType.CONFIGURE)
                 save_window_size ();
 
@@ -179,14 +179,14 @@ private class Boxes.App: Boxes.UI {
     }
 
     public void save_window_size () {
-        float w, h;
+        float width, height;
 
 		if (ui_state == UIState.DISPLAY)
 			return;
 
-        window.get_size (out w, out h);
-        window.default_width = (int)w;
-        window.default_height = (int)h;
+        window.get_size (out width, out height);
+        window.default_width = (int) width;
+        window.default_height = (int) height;
     }
 
     public void restore_window_size () {
diff --git a/src/collection-view.vala b/src/collection-view.vala
index 7fc89fd..db439ce 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -65,7 +65,7 @@ private class Boxes.CollectionView: Boxes.UI {
 
     public void add_item (CollectionItem item) {
         if (item is Box) {
-            var box = (Box)item;
+            var box = item as Box;
 
             box.actor.ui_state = UIState.COLLECTION;
             actor_add (box.get_clutter_actor (), boxes);
@@ -75,7 +75,7 @@ private class Boxes.CollectionView: Boxes.UI {
 
     public void remove_item (CollectionItem item) {
         if (item is Box) {
-            var box = (Box)item;
+            var box = item as Box;
             var actor = box.get_clutter_actor ();
             if (actor.get_parent () == boxes)
                 boxes.remove_actor (actor); // FIXME: why Clutter warn here??!
diff --git a/src/sidebar.vala b/src/sidebar.vala
index f5699cc..035a5ae 100644
--- a/src/sidebar.vala
+++ b/src/sidebar.vala
@@ -54,7 +54,7 @@ private class Boxes.Sidebar: Boxes.UI {
 
     private void setup_sidebar () {
         notebook = new Gtk.Notebook ();
-        notebook.set_size_request ((int)width, 100);
+        notebook.set_size_request ((int) width, 100);
 
         var vbox = new Gtk.VBox (false, 0);
         notebook.append_page (vbox, new Gtk.Label (""));
diff --git a/src/topbar.vala b/src/topbar.vala
index bfc1a3d..691d90d 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -25,7 +25,7 @@ private class Boxes.Topbar: Boxes.UI {
 
     private void setup_topbar () {
         notebook = new Gtk.Notebook ();
-        notebook.set_size_request (50, (int)height);
+        notebook.set_size_request (50, (int) height);
         actor = new GtkClutter.Actor.with_contents (notebook);
         app.box.pack (actor,
                       "column", 0,
@@ -48,7 +48,7 @@ private class Boxes.Topbar: Boxes.UI {
         var back = new Gtk.ToolButton (null, null);
         back.icon_name =  "go-previous-symbolic";
         back.get_style_context ().add_class ("raised");
-        back.clicked.connect ( (button) => { app.go_back (); });
+        back.clicked.connect ((button) => { app.go_back (); });
         toolbar_start.insert (back, 0);
         toolbar_start.set_show_arrow (false);
         hbox.pack_start (toolbar_start, false, false, 0);
@@ -90,7 +90,7 @@ private class Boxes.Topbar: Boxes.UI {
             break;
 
         case UIState.DISPLAY:
-            pin_actor(actor);
+            pin_actor (actor);
             break;
 
         default:
diff --git a/src/util.vala b/src/util.vala
index 2d033b4..7fb8ab4 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -39,7 +39,7 @@ namespace Boxes {
                 int x, y;
 
                 if (event.button == 1 && event.type == Gdk.EventType.BUTTON_PRESS) {
-                    tree_view.get_path_at_pos ((int)event.x, (int)event.y, out path, out column, out x, out y);
+                    tree_view.get_path_at_pos ((int) event.x, (int) event.y, out path, out column, out x, out y);
                     if (path != null)
                         tree_view.row_activated (path, column);
                 }



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