Commit 100ba132 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

Place property getters before setters

Follow the coding style described in CodingStyle.txt
parent d8c2bf02
......@@ -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;
......
// 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;
......
// 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;
......
// 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 ();
......
......@@ -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;
......
......@@ -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;
......
// 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) {
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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]
......
......@@ -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]
......
......@@ -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]
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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;
......
......@@ -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]
......
// 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 () {}
}
......@@ -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;
......
......@@ -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;
......
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment