[gnome-games] Assorted code style fixes



commit dec0e016413d6bdfbf874ce8b115c3ca11eee358
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Jan 28 21:13:11 2020 +0500

    Assorted code style fixes
    
    Fix some errors found by vala-lint. Unfortunately, the linter itself is not
    very for us useful right now with its many false positives
    (see https://github.com/vala-lang/vala-lint/issues/124) and the fact it
    seems to be impossible to check for tabs instead of 4-spaces indentation.

 plugins/steam/src/steam-registry.vala   | 4 ++--
 plugins/steam/src/steam-uri-source.vala | 3 +--
 src/grilo/grilo-cover.vala              | 2 +-
 src/ui/application.vala                 | 2 +-
 src/ui/display-view.vala                | 2 +-
 src/ui/game-thumbnail.vala              | 2 +-
 src/ui/preferences-window.vala          | 2 +-
 src/ui/savestate-listbox-row.vala       | 5 ++---
 src/ui/savestates-list.vala             | 2 +-
 src/ui/shortcuts-window.vala            | 1 -
 10 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/plugins/steam/src/steam-registry.vala b/plugins/steam/src/steam-registry.vala
index fbb757df..7ae9db4d 100644
--- a/plugins/steam/src/steam-registry.vala
+++ b/plugins/steam/src/steam-registry.vala
@@ -22,7 +22,7 @@ private class Games.SteamRegistry {
                        if (node == null)
                                return {};
 
-                       if (i < path.length -1) {
+                       if (i < path.length - 1) {
                                current_value = node.get_child (path[i + 1]);
                        }
                        else {
@@ -42,7 +42,7 @@ private class Games.SteamRegistry {
                        if (current_value.tag != path[i])
                                return null;
 
-                       if (i < path.length -1) {
+                       if (i < path.length - 1) {
                                var node = current_value as SteamRegistryNode;
                                if (node == null)
                                        return null;
diff --git a/plugins/steam/src/steam-uri-source.vala b/plugins/steam/src/steam-uri-source.vala
index 40efad90..114c9c77 100644
--- a/plugins/steam/src/steam-uri-source.vala
+++ b/plugins/steam/src/steam-uri-source.vala
@@ -6,8 +6,7 @@ private class Games.SteamUriSource : Object, UriSource {
        // From the home directory.
        private const string REGISTRY_PATH = "/.steam/registry.vdf";
 
-       private const string[] APPS_REGISTRY_PATH =
-               { "Registry", "HKCU", "Software", "Valve", "Steam", "Apps" };
+       private const string[] APPS_REGISTRY_PATH = { "Registry", "HKCU", "Software", "Valve", "Steam", 
"Apps" };
 
        private string uri_scheme;
        private SteamGameData game_data;
diff --git a/src/grilo/grilo-cover.vala b/src/grilo/grilo-cover.vala
index ef3ad045..53ce7a26 100644
--- a/src/grilo/grilo-cover.vala
+++ b/src/grilo/grilo-cover.vala
@@ -73,7 +73,7 @@ public class Games.GriloCover : Object, Cover {
                }
        }
 
-       private async void fetch_cover (string uri) throws Error{
+       private async void fetch_cover (string uri) throws Error {
                var dir = Application.get_covers_dir ();
                Application.try_make_dir (dir);
 
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 9d3bbefe..20acd729 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -17,7 +17,7 @@ public class Games.Application : Gtk.Application {
 
        private Manette.Monitor manette_monitor;
 
-       private const GLib.ActionEntry[] action_entries = {
+       private const ActionEntry[] action_entries = {
                { "preferences",    preferences      },
                { "help",           help             },
                { "about",          about            },
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index 2172d4d8..e7421ee3 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -178,7 +178,7 @@ private class Games.DisplayView : Object, UiView {
                }
 
                if (((keyval == Gdk.Key.s || keyval == Gdk.Key.S) && ctrl_pressed) ||
-                    (keyval == Gdk.Key.F2)){
+                    (keyval == Gdk.Key.F2)) {
                        create_new_savestate ();
 
                        return true;
diff --git a/src/ui/game-thumbnail.vala b/src/ui/game-thumbnail.vala
index 04fab0ff..edc03970 100644
--- a/src/ui/game-thumbnail.vala
+++ b/src/ui/game-thumbnail.vala
@@ -260,7 +260,7 @@ private class Games.GameThumbnail : Gtk.DrawingArea {
                const double ARC_3 = Math.PI * 1.5;
 
                cr.new_sub_path ();
-               cr.arc (x + width - radius, y + radius,          radius, ARC_3, ARC_0);
+               cr.arc (x + width - radius, y + radius,          radius, ARC_3, ARC_0);
                cr.arc (x + width - radius, y + height - radius, radius, ARC_0, ARC_1);
                cr.arc (x + radius,         y + height - radius, radius, ARC_1, ARC_2);
                cr.arc (x + radius,         y + radius,          radius, ARC_2, ARC_3);
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index c88d5bf5..596b0007 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -119,7 +119,7 @@ private class Games.PreferencesWindow : Gtk.Window {
        }
 
        [GtkCallback]
-       private void on_folded_changed (Object object, ParamSpec paramSpec) {
+       private void on_folded_changed () {
                var folded = content_box.folded;
 
                update_header_group ();
diff --git a/src/ui/savestate-listbox-row.vala b/src/ui/savestate-listbox-row.vala
index 325edd9a..ea7ab984 100644
--- a/src/ui/savestate-listbox-row.vala
+++ b/src/ui/savestate-listbox-row.vala
@@ -103,7 +103,7 @@ private class Games.SavestateListBoxRow : Gtk.ListBoxRow {
 
        public void remove_animated () {
                selectable = false;
-               revealer.notify["child-revealed"].connect(() => {
+               revealer.notify["child-revealed"].connect (() => {
                        get_parent ().remove (this);
                });
                revealer.reveal_child = false;
@@ -167,7 +167,7 @@ private class Games.SavestateListBoxRow : Gtk.ListBoxRow {
                const double ARC_3 = Math.PI * 1.5;
 
                cr.new_sub_path ();
-               cr.arc (x + width - radius, y + radius,          radius, ARC_3, ARC_0);
+               cr.arc (x + width - radius, y + radius,          radius, ARC_3, ARC_0);
                cr.arc (x + width - radius, y + height - radius, radius, ARC_0, ARC_1);
                cr.arc (x + radius,         y + height - radius, radius, ARC_1, ARC_2);
                cr.arc (x + radius,         y + radius,          radius, ARC_2, ARC_3);
@@ -219,4 +219,3 @@ private class Games.SavestateListBoxRow : Gtk.ListBoxRow {
                }
        }
 }
-
diff --git a/src/ui/savestates-list.vala b/src/ui/savestates-list.vala
index 15e2371e..109fcc1b 100644
--- a/src/ui/savestates-list.vala
+++ b/src/ui/savestates-list.vala
@@ -75,7 +75,7 @@ private class Games.SavestatesList : Gtk.Box {
 
        private void populate_list_box () {
                // Remove current savestate rows
-               var list_rows =  list_box.get_children ();
+               var list_rows = list_box.get_children ();
                foreach (var row in list_rows) {
                        if (row != new_savestate_row)
                                list_box.remove (row);
diff --git a/src/ui/shortcuts-window.vala b/src/ui/shortcuts-window.vala
index 5c883467..d5376b06 100644
--- a/src/ui/shortcuts-window.vala
+++ b/src/ui/shortcuts-window.vala
@@ -14,4 +14,3 @@ private class Games.ShortcutsWindow : Gtk.ShortcutsWindow {
                general_shortcut_alt_left.accelerator = get_direction () == Gtk.TextDirection.LTR ? 
"<alt>Left" : "<alt>Right";
        }
 }
-


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