[gnome-games/wip/exalm/cleanups: 2/2] Place property getters before setters
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/cleanups: 2/2] Place property getters before setters
- Date: Wed, 12 Sep 2018 11:54:47 +0000 (UTC)
commit 91dce40f3b2602b6c0c3f23e88fd477492b926e9
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Tue Sep 4 17:11:39 2018 +0500
Place property getters before setters
Follow the coding style described in CodingStyle.txt
Fixes #110
src/core/media-set/media-set.vala | 4 ++--
src/core/plugin-registrar.vala | 4 ++--
src/gameinfo/gameinfo-disc-id-input-capabilities.vala | 4 ++--
src/keyboard/keyboard-mapping-builder.vala | 2 +-
src/keyboard/keyboard-mapping-manager.vala | 2 +-
src/retro/retro-runner.vala | 2 +-
src/tracker/tracker-uri-source.vala | 2 +-
src/ui/application-window.vala | 10 +++++-----
src/ui/checkmark-item.vala | 2 +-
src/ui/collection-box.vala | 8 ++++----
src/ui/collection-header-bar.vala | 6 +++---
src/ui/collection-icon-view.vala | 10 +++++-----
src/ui/display-box.vala | 4 ++--
src/ui/display-header-bar.vala | 4 ++--
src/ui/keyboard-configurer.vala | 6 +++---
src/ui/keyboard-tester.vala | 2 +-
src/ui/media-menu-button.vala | 2 +-
src/ui/preferences-page-controllers.vala | 4 ++--
src/ui/preferences-page-plugins.vala | 4 ++--
src/ui/preferences-page.vala | 4 ++--
src/ui/preferences-window.vala | 4 ++--
src/ui/search-bar.vala | 2 +-
src/ui/sidebar-view.vala | 8 ++++----
23 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/src/core/media-set/media-set.vala b/src/core/media-set/media-set.vala
index 7f9e235c..3febbd71 100644
--- a/src/core/media-set/media-set.vala
+++ b/src/core/media-set/media-set.vala
@@ -3,8 +3,8 @@
public class Games.MediaSet : Object {
public delegate void MediaCallback (Media media);
- public int selected_media_number { set; get; default = 0; }
- public GLib.Icon? icon { set; get; }
+ public int selected_media_number { get; set; default = 0; }
+ public GLib.Icon? icon { get; set; }
private Media[] medias;
diff --git a/src/core/plugin-registrar.vala b/src/core/plugin-registrar.vala
index 8c4f97ca..b60c2a99 100644
--- a/src/core/plugin-registrar.vala
+++ b/src/core/plugin-registrar.vala
@@ -1,8 +1,8 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.PluginRegistrar : TypeModule {
- public string name { private set; get; }
- public string description { private set; get; }
+ public string name { get; private set; }
+ public string description { get; private set; }
private Plugin plugin;
private string module_path;
diff --git a/src/gameinfo/gameinfo-disc-id-input-capabilities.vala
b/src/gameinfo/gameinfo-disc-id-input-capabilities.vala
index f5c40d32..9bee5d2c 100644
--- a/src/gameinfo/gameinfo-disc-id-input-capabilities.vala
+++ b/src/gameinfo/gameinfo-disc-id-input-capabilities.vala
@@ -1,8 +1,8 @@
// This file is part of GNOME Games. License: GPL-3.0+.
public class Games.GameinfoDiscIdInputCapabilities : Object, InputCapabilities {
- public bool default_allow_classic_gamepads { set; get; }
- public bool default_allow_analog_gamepads { set; get; }
+ public bool default_allow_classic_gamepads { get; set; }
+ public bool default_allow_analog_gamepads { get; set; }
private GameinfoDoc gameinfo;
private string disc_id;
diff --git a/src/keyboard/keyboard-mapping-builder.vala b/src/keyboard/keyboard-mapping-builder.vala
index dd52a053..f3327b13 100644
--- a/src/keyboard/keyboard-mapping-builder.vala
+++ b/src/keyboard/keyboard-mapping-builder.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private class Games.KeyboardMappingBuilder : Object {
- public Retro.KeyJoypadMapping mapping { private set; get; }
+ public Retro.KeyJoypadMapping mapping { get; private set; }
construct {
mapping = new Retro.KeyJoypadMapping ();
diff --git a/src/keyboard/keyboard-mapping-manager.vala b/src/keyboard/keyboard-mapping-manager.vala
index 7d6a258a..c389a5b3 100644
--- a/src/keyboard/keyboard-mapping-manager.vala
+++ b/src/keyboard/keyboard-mapping-manager.vala
@@ -5,7 +5,7 @@ private class Games.KeyboardMappingManager : Object {
private const string GROUP_NAME = "KeyboardMapping";
public signal void changed ();
- public Retro.KeyJoypadMapping mapping { private set; get; }
+ public Retro.KeyJoypadMapping mapping { get; private set; }
private File mapping_file;
private FileMonitor mapping_monitor;
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 48f0709a..d14bf4b1 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -53,6 +53,7 @@ public class Games.RetroRunner : Object, Runner {
private bool _running;
private bool running {
+ get { return _running; }
set {
_running = value;
@@ -61,7 +62,6 @@ public class Games.RetroRunner : Object, Runner {
view.sensitive = running;
}
- get { return _running; }
}
private bool is_initialized;
diff --git a/src/tracker/tracker-uri-source.vala b/src/tracker/tracker-uri-source.vala
index 75bb6778..3a6ec58d 100644
--- a/src/tracker/tracker-uri-source.vala
+++ b/src/tracker/tracker-uri-source.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
public class Games.TrackerUriSource : Object, UriSource {
- private Tracker.Sparql.Connection connection { private set; get; }
+ private Tracker.Sparql.Connection connection { get; private set; }
private TrackerUriQuery[] queries;
public TrackerUriSource (Tracker.Sparql.Connection connection) {
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 53debf3c..d5fbcb09 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -9,6 +9,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
private UiState _ui_state;
public UiState ui_state {
+ get { return _ui_state; }
set {
if (value == ui_state)
return;
@@ -39,11 +40,11 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
konami_code.reset ();
}
- get { return _ui_state; }
}
private bool _is_fullscreen;
public bool is_fullscreen {
+ get { return _is_fullscreen; }
set {
_is_fullscreen = value && (ui_state == UiState.DISPLAY);
@@ -52,18 +53,17 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
else
unfullscreen ();
}
- get { return _is_fullscreen; }
}
private bool _search_mode;
public bool search_mode {
- set { _search_mode = value && (ui_state == UiState.COLLECTION); }
get { return _search_mode; }
+ set { _search_mode = value && (ui_state == UiState.COLLECTION); }
}
- public bool is_collection_empty { set; get; }
+ public bool is_collection_empty { get; set; }
- public bool loading_notification { set; get; }
+ public bool loading_notification { get; set; }
[GtkChild]
private Gtk.Stack content_box;
diff --git a/src/ui/checkmark-item.vala b/src/ui/checkmark-item.vala
index 83825842..d28c96a1 100644
--- a/src/ui/checkmark-item.vala
+++ b/src/ui/checkmark-item.vala
@@ -7,7 +7,7 @@ private class Games.CheckmarkItem: Gtk.Box {
[GtkChild]
private Gtk.Image checkmark_image;
- public bool checkmark_visible { set; get; }
+ public bool checkmark_visible { get; set; }
private Binding checkmark_visible_binding;
public CheckmarkItem (string name) {
diff --git a/src/ui/collection-box.vala b/src/ui/collection-box.vala
index de2c95c2..79bf0290 100644
--- a/src/ui/collection-box.vala
+++ b/src/ui/collection-box.vala
@@ -4,9 +4,9 @@
private class Games.CollectionBox : Gtk.Box {
public signal void game_activated (Game game);
- public ListModel collection { construct set; get; }
- public bool search_mode { set; get; }
- public bool loading_notification { set; get; }
+ public ListModel collection { get; construct set; }
+ public bool search_mode { get; set; }
+ public bool loading_notification { get; set; }
[GtkChild]
private SearchBar search_bar;
@@ -28,6 +28,7 @@ private class Games.CollectionBox : Gtk.Box {
private bool _is_collection_empty;
public bool is_collection_empty {
+ get { return _is_collection_empty; }
set {
_is_collection_empty = value;
if (_is_collection_empty)
@@ -35,7 +36,6 @@ private class Games.CollectionBox : Gtk.Box {
else
viewstack.visible_child = collection_view;
}
- get { return _is_collection_empty; }
}
private Binding collection_binding;
diff --git a/src/ui/collection-header-bar.vala b/src/ui/collection-header-bar.vala
index f98d9279..5e98107d 100644
--- a/src/ui/collection-header-bar.vala
+++ b/src/ui/collection-header-bar.vala
@@ -2,18 +2,19 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/collection-header-bar.ui")]
private class Games.CollectionHeaderBar : Gtk.HeaderBar {
- public bool search_mode { set; get; }
+ public bool search_mode { get; set; }
private Gtk.Stack _viewstack;
public Gtk.Stack viewstack {
+ get { return _viewstack; }
set {
_viewstack = value;
view_switcher.set_stack (_viewstack);
}
- get { return _viewstack; }
}
private bool _is_collection_empty;
public bool is_collection_empty {
+ get { return _is_collection_empty; }
set {
_is_collection_empty = value;
if (_is_collection_empty)
@@ -22,7 +23,6 @@ private class Games.CollectionHeaderBar : Gtk.HeaderBar {
title_stack.visible_child = view_switcher;
search.sensitive = !_is_collection_empty;
}
- get { return _is_collection_empty; }
}
[GtkChild]
diff --git a/src/ui/collection-icon-view.vala b/src/ui/collection-icon-view.vala
index fbce6496..49d62e83 100644
--- a/src/ui/collection-icon-view.vala
+++ b/src/ui/collection-icon-view.vala
@@ -14,20 +14,20 @@ private class Games.CollectionIconView : Gtk.Bin {
private Developer? _filtering_developer;
public Developer? filtering_developer {
+ get { return _filtering_developer; }
set {
_filtering_developer = value;
flow_box.invalidate_filter ();
}
- get { return _filtering_developer; }
}
private Platform? _filtering_platform;
public Platform? filtering_platform {
+ get { return _filtering_platform; }
set {
_filtering_platform = value;
flow_box.invalidate_filter ();
}
- get { return _filtering_platform; }
}
private ulong model_changed_id;
@@ -56,6 +56,9 @@ private class Games.CollectionIconView : Gtk.Bin {
private Binding window_active_binding;
private bool _is_active;
public bool is_active {
+ get {
+ return _is_active;
+ }
set {
if (_is_active == value)
return;
@@ -65,9 +68,6 @@ private class Games.CollectionIconView : Gtk.Bin {
if (!_is_active)
gamepad_browse.cancel_cursor_movement ();
}
- get {
- return _is_active;
- }
}
[GtkChild]
diff --git a/src/ui/display-box.vala b/src/ui/display-box.vala
index b82e037a..704f354d 100644
--- a/src/ui/display-box.vala
+++ b/src/ui/display-box.vala
@@ -6,7 +6,7 @@ private class Games.DisplayBox : Gtk.EventBox {
public signal void back ();
- public bool is_fullscreen { set; get; }
+ public bool is_fullscreen { get; set; }
public DisplayHeaderBar header_bar {
get { return fullscreen_header_bar; }
@@ -14,6 +14,7 @@ private class Games.DisplayBox : Gtk.EventBox {
private Runner _runner;
public Runner runner {
+ get { return _runner; }
set {
stack.visible_child = display_bin;
@@ -26,7 +27,6 @@ private class Games.DisplayBox : Gtk.EventBox {
var display = runner.get_display ();
set_display (display);
}
- get { return _runner; }
}
[GtkChild]
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index 5fa67496..419dc7ac 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -11,8 +11,8 @@ private class Games.DisplayHeaderBar : Gtk.HeaderBar {
set { title = value; }
}
- public bool can_fullscreen { set; get; }
- public bool is_fullscreen { set; get; }
+ public bool can_fullscreen { get; set; }
+ public bool is_fullscreen { get; set; }
public MediaSet? media_set {
set {
diff --git a/src/ui/keyboard-configurer.vala b/src/ui/keyboard-configurer.vala
index 990a9150..34ccddb0 100644
--- a/src/ui/keyboard-configurer.vala
+++ b/src/ui/keyboard-configurer.vala
@@ -53,6 +53,7 @@ private class Games.KeyboardConfigurer : Gtk.Box {
private State _state;
private State state {
+ get { return _state; }
set {
_state = value;
immersive_mode = (state == State.CONFIGURE);
@@ -88,17 +89,16 @@ private class Games.KeyboardConfigurer : Gtk.Box {
break;
}
}
- get { return _state; }
}
[GtkChild (name = "header_bar")]
private Gtk.HeaderBar _header_bar;
public Gtk.HeaderBar header_bar {
- private set {}
get { return _header_bar; }
+ private set {}
}
- public bool immersive_mode { private set; get; }
+ public bool immersive_mode { get; private set; }
[GtkChild]
private Gtk.Stack stack;
diff --git a/src/ui/keyboard-tester.vala b/src/ui/keyboard-tester.vala
index 932c9005..338e0e7a 100644
--- a/src/ui/keyboard-tester.vala
+++ b/src/ui/keyboard-tester.vala
@@ -5,7 +5,7 @@ private class Games.KeyboardTester : Gtk.Box {
[GtkChild]
private GamepadView gamepad_view;
- public Retro.KeyJoypadMapping mapping { set; get; }
+ public Retro.KeyJoypadMapping mapping { get; set; }
public KeyboardTester (GamepadViewConfiguration configuration) {
try {
diff --git a/src/ui/media-menu-button.vala b/src/ui/media-menu-button.vala
index 2ec402dd..dd074a3b 100644
--- a/src/ui/media-menu-button.vala
+++ b/src/ui/media-menu-button.vala
@@ -2,7 +2,7 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/media-menu-button.ui")]
private class Games.MediaMenuButton : Gtk.MenuButton {
- public MediaSet media_set { set; get; }
+ public MediaSet media_set { get; set; }
[GtkChild]
private Gtk.Image media_image;
diff --git a/src/ui/preferences-page-controllers.vala b/src/ui/preferences-page-controllers.vala
index a0f376d2..8a68073c 100644
--- a/src/ui/preferences-page-controllers.vala
+++ b/src/ui/preferences-page-controllers.vala
@@ -2,8 +2,8 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/preferences-page-controllers.ui")]
private class Games.PreferencesPageControllers: Gtk.Stack, PreferencesPage {
- public Gtk.HeaderBar header_bar { protected set; get; }
- public bool immersive_mode { protected set; get; }
+ public Gtk.HeaderBar header_bar { get; protected set; }
+ public bool immersive_mode { get; protected set; }
[GtkChild]
private Gtk.Label gamepads_label;
diff --git a/src/ui/preferences-page-plugins.vala b/src/ui/preferences-page-plugins.vala
index a64f55d2..5e85c30b 100644
--- a/src/ui/preferences-page-plugins.vala
+++ b/src/ui/preferences-page-plugins.vala
@@ -5,13 +5,13 @@ private class Games.PreferencesPagePlugins: Gtk.Bin, PreferencesPage {
[GtkChild (name = "header_bar")]
private Gtk.HeaderBar _header_bar;
public Gtk.HeaderBar header_bar {
- protected set {}
get { return _header_bar; }
+ protected set {}
}
public bool immersive_mode {
- protected set {}
get { return false; }
+ protected set {}
}
[GtkChild]
diff --git a/src/ui/preferences-page.vala b/src/ui/preferences-page.vala
index bd8576fa..b4d37fb1 100644
--- a/src/ui/preferences-page.vala
+++ b/src/ui/preferences-page.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
private interface Games.PreferencesPage: Gtk.Widget {
- public abstract Gtk.HeaderBar header_bar { protected set; get; }
- public abstract bool immersive_mode { protected set; get; }
+ public abstract Gtk.HeaderBar header_bar { get; protected set; }
+ public abstract bool immersive_mode { get; protected set; }
public virtual void visible_page_changed () {}
}
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index 68823ecc..77fb3ce1 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -17,6 +17,7 @@ private class Games.PreferencesWindow : Gtk.Window {
private Gtk.HeaderBar _right_header_bar;
public Gtk.HeaderBar right_header_bar {
+ get { return _right_header_bar; }
set {
if (_right_header_bar != null)
titlebar_box.remove (_right_header_bar);
@@ -26,11 +27,11 @@ private class Games.PreferencesWindow : Gtk.Window {
}
_right_header_bar = value;
}
- get { return _right_header_bar; }
}
private bool _immersive_mode;
public bool immersive_mode {
+ get { return _immersive_mode; }
set {
header_separator.visible = !value;
left_header_bar.visible = !value;
@@ -41,7 +42,6 @@ private class Games.PreferencesWindow : Gtk.Window {
_immersive_mode = value;
}
- get { return _immersive_mode; }
}
private Binding right_header_bar_binding;
diff --git a/src/ui/search-bar.vala b/src/ui/search-bar.vala
index ed4876f6..fa1d61bd 100644
--- a/src/ui/search-bar.vala
+++ b/src/ui/search-bar.vala
@@ -2,7 +2,7 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/search-bar.ui")]
private class Games.SearchBar : Gtk.SearchBar {
- public string text { private set; get; }
+ public string text { get; private set; }
[GtkChild]
private Gtk.SearchEntry entry;
diff --git a/src/ui/sidebar-view.vala b/src/ui/sidebar-view.vala
index 9acc0519..9981b35b 100644
--- a/src/ui/sidebar-view.vala
+++ b/src/ui/sidebar-view.vala
@@ -12,6 +12,7 @@ private abstract class Games.SidebarView : Gtk.Box {
private ListModel _model;
public ListModel model {
+ get { return _model; }
set {
if (model_items_changed_id != 0) {
_model.disconnect (model_items_changed_id);
@@ -24,12 +25,14 @@ private abstract class Games.SidebarView : Gtk.Box {
if (model != null)
model_items_changed_id = model.items_changed.connect (on_model_changed);
}
- get { return _model; }
}
private Binding window_active_binding;
private bool _is_active;
public bool is_active {
+ get {
+ return _is_active;
+ }
set {
if (_is_active == value)
return;
@@ -39,9 +42,6 @@ private abstract class Games.SidebarView : Gtk.Box {
if (!_is_active)
gamepad_browse.cancel_cursor_movement ();
}
- get {
- return _is_active;
- }
}
[GtkChild]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]