[gnome-usage] Move getters before setters
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] Move getters before setters
- Date: Mon, 22 Nov 2021 12:27:29 +0000 (UTC)
commit 62e6c0c9e3d721a35850b5e7976920cfa9c43a0f
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Nov 22 12:01:07 2021 +0100
Move getters before setters
This makes the coding style more consistent.
src/graph-stacked-renderer.vala | 8 ++++----
src/storage/storage-graph.vala | 6 +++---
src/storage/storage-view-item.vala | 8 ++++----
src/storage/storage-view-row.vala | 12 ++++++------
4 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/graph-stacked-renderer.vala b/src/graph-stacked-renderer.vala
index f7befe5..a27abd2 100644
--- a/src/graph-stacked-renderer.vala
+++ b/src/graph-stacked-renderer.vala
@@ -25,10 +25,10 @@ namespace Usage {
public class GraphStackedRenderer : Object, GraphRenderer {
- public uint column { set; get; }
- public double line_width { set; get; default = 1.0; }
- public Gdk.RGBA stroke_color_rgba { set; get; }
- public Gdk.RGBA stacked_color_rgba { set; get; }
+ public uint column { get; set; }
+ public double line_width { get; set; default = 1.0; }
+ public Gdk.RGBA stroke_color_rgba { get; set; }
+ public Gdk.RGBA stacked_color_rgba { get; set; }
public void render(GraphModel model, int64 x_begin, int64 x_end, double y_begin, double y_end,
Context cr, RectangleInt area) {
GraphModelIter iter;
diff --git a/src/storage/storage-graph.vala b/src/storage/storage-graph.vala
index 6140aff..89d35b4 100644
--- a/src/storage/storage-graph.vala
+++ b/src/storage/storage-graph.vala
@@ -25,9 +25,10 @@ namespace Usage {
private unowned List<StorageViewItem> selected_items;
private unowned GLib.ListStore _model;
private uint64 selected_size = 0;
- private bool root { private set; get; }
+ private bool root { get; private set; }
public unowned GLib.ListStore model {
+ get { return _model; }
set {
_model = value;
this.draw.connect(draw_storage_graph);
@@ -42,10 +43,9 @@ namespace Usage {
}
}
}
- get { return _model; }
}
- public uint min_percentage_shown_files { set; get; }
+ public uint min_percentage_shown_files { get; set; }
class construct {
set_css_name("StorageGraph");
diff --git a/src/storage/storage-view-item.vala b/src/storage/storage-view-item.vala
index 22eaeb1..0a52a68 100644
--- a/src/storage/storage-view-item.vala
+++ b/src/storage/storage-view-item.vala
@@ -28,7 +28,7 @@ public enum StorageViewType {
}
public class Usage.StorageViewItem : GLib.Object {
- public double percentage { set; get; }
+ public double percentage { get; set; }
public bool loaded { get; set; default = false; }
public Gdk.RGBA color { get; set; }
@@ -43,9 +43,6 @@ public class Usage.StorageViewItem : GLib.Object {
private string _style_class = null;
public string style_class {
- protected set {
- _style_class = value;
- }
get {
if (_style_class != null)
return _style_class;
@@ -54,6 +51,9 @@ public class Usage.StorageViewItem : GLib.Object {
return _style_class;
}
+ protected set {
+ _style_class = value;
+ }
}
public bool show_check_button {
diff --git a/src/storage/storage-view-row.vala b/src/storage/storage-view-row.vala
index 670dd80..b72253f 100644
--- a/src/storage/storage-view-row.vala
+++ b/src/storage/storage-view-row.vala
@@ -21,12 +21,12 @@
[GtkTemplate (ui = "/org/gnome/Usage/ui/storage-view-row.ui")]
public class Usage.StorageViewRow : Gtk.ListBoxRow {
public string label {
- set {
- title.label = value;
- }
get {
return title.label;
}
+ set {
+ title.label = value;
+ }
}
[GtkChild]
@@ -49,14 +49,14 @@ public class Usage.StorageViewRow : Gtk.ListBoxRow {
BIG,
}
public TagSize tag_size {
+ get {
+ return (tag.width_request == 20 ? TagSize.BIG : TagSize.SMALL);
+ }
set {
if (value == TagSize.BIG) {
tag.width_request = tag.height_request = 20;
}
}
- get {
- return (tag.width_request == 20 ? TagSize.BIG : TagSize.SMALL);
- }
}
public bool selected {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]