[gnome-usage] Put spaces before braces
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] Put spaces before braces
- Date: Mon, 22 Nov 2021 12:27:29 +0000 (UTC)
commit e016f447f945cadc27d5d593085fb1c62defdc42
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Nov 22 12:47:15 2021 +0100
Put spaces before braces
This makes the coding style more consistent.
src/app-item.vala | 6 +++---
src/cpu-graph-model.vala | 14 +++++++-------
src/cpu-graph.vala | 4 ++--
src/cpu-sub-view.vala | 2 +-
src/graph-stack-switcher.vala | 4 ++--
src/graph-switcher-button.vala | 2 +-
src/memory-graph-model.vala | 10 +++++-----
src/memory-graph.vala | 2 +-
src/memory-sub-view.vala | 2 +-
src/pie-chart.vala | 4 ++--
src/process-list-box.vala | 12 ++++++------
src/process-row.vala | 6 +++---
src/process.vala | 2 +-
src/storage/storage-actionbar.vala | 8 ++++----
src/storage/storage-graph.vala | 30 +++++++++++++++---------------
src/storage/storage-view-item.vala | 4 ++--
src/storage/storage-view-row.vala | 6 +++---
src/storage/storage-view.vala | 24 ++++++++++++------------
src/storage/tracker-controller.vala | 4 ++--
src/system-monitor.vala | 2 +-
src/utils.vala | 24 ++++++++++++------------
src/window.vala | 6 +++---
22 files changed, 89 insertions(+), 89 deletions(-)
---
diff --git a/src/app-item.vala b/src/app-item.vala
index 0d4c06f..8046ff7 100644
--- a/src/app-item.vala
+++ b/src/app-item.vala
@@ -197,13 +197,13 @@ namespace Usage {
int games = 0;
foreach(var process in processes.get_values()) {
- if(!process.mark_as_updated) {
+ if (!process.mark_as_updated) {
processes.remove(process.pid);
} else {
cpu_load += process.cpu_load;
mem_usage += process.mem_usage;
}
- if(process.gamemode)
+ if (process.gamemode)
games++;
}
@@ -220,7 +220,7 @@ namespace Usage {
}
private string find_display_name() {
- if(app_info != null)
+ if (app_info != null)
return app_info.get_display_name();
else
return representative_cmdline;
diff --git a/src/cpu-graph-model.vala b/src/cpu-graph-model.vala
index df6b8a0..a8a7fa8 100644
--- a/src/cpu-graph-model.vala
+++ b/src/cpu-graph-model.vala
@@ -59,14 +59,14 @@ namespace Usage {
for (int i = 0; i < get_num_processors(); i++) {
iter_set_value(iter, i, monitor.x_cpu_load[i]);
- if(monitor.x_cpu_load[i] >= 90) {
- if(change_big_process_usage[i]) {
+ if (monitor.x_cpu_load[i] >= 90) {
+ if (change_big_process_usage[i]) {
big_process_usage(i);
change_big_process_usage[i] = false;
change_small_process_usage[i] = true;
}
} else {
- if(change_small_process_usage[i]) {
+ if (change_small_process_usage[i]) {
small_process_usage(i);
change_small_process_usage[i] = false;
change_big_process_usage[i] = true;
@@ -103,20 +103,20 @@ namespace Usage {
double most_used_core = monitor.x_cpu_load[0];
for (int i = 1; i < get_num_processors(); i++) {
- if(monitor.x_cpu_load[i] > most_used_core)
+ if (monitor.x_cpu_load[i] > most_used_core)
most_used_core = monitor.x_cpu_load[i];
}
iter_set_value(iter, 0, most_used_core);
- if(most_used_core >= 90) {
- if(change_big_process_usage) {
+ if (most_used_core >= 90) {
+ if (change_big_process_usage) {
big_process_usage();
change_big_process_usage = false;
change_small_process_usage = true;
}
} else {
- if(change_small_process_usage) {
+ if (change_small_process_usage) {
small_process_usage();
change_small_process_usage = false;
change_big_process_usage = true;
diff --git a/src/cpu-graph.vala b/src/cpu-graph.vala
index 1718230..81679ab 100644
--- a/src/cpu-graph.vala
+++ b/src/cpu-graph.vala
@@ -50,7 +50,7 @@ namespace Usage {
color_normal = get_style_context().get_color(get_style_context().get_state());
get_style_context().remove_class("stacked");
- if(graph_model == null)
+ if (graph_model == null)
graph_model = new CpuGraphModelMostUsedCore();
set_model(graph_model);
@@ -95,7 +95,7 @@ namespace Usage {
get_style_context().remove_class("line");
get_style_context().add_class("big");
- if(graph_model == null)
+ if (graph_model == null)
graph_model = new CpuGraphModel();
set_model(graph_model);
diff --git a/src/cpu-sub-view.vala b/src/cpu-sub-view.vala
index 5304aea..10a1185 100644
--- a/src/cpu-sub-view.vala
+++ b/src/cpu-sub-view.vala
@@ -56,7 +56,7 @@ namespace Usage {
var system_monitor = SystemMonitor.get_default();
system_monitor.notify["process-list-ready"].connect ((sender, property) => {
- if(system_monitor.process_list_ready) {
+ if (system_monitor.process_list_ready) {
cpu_box.pack_start(process_list_box, false, false, 0);
cpu_box.remove(spinner);
} else {
diff --git a/src/graph-stack-switcher.vala b/src/graph-stack-switcher.vala
index 0c28e70..d939518 100644
--- a/src/graph-stack-switcher.vala
+++ b/src/graph-stack-switcher.vala
@@ -56,7 +56,7 @@ namespace Usage {
private int get_button_number(Gtk.Button button) {
for(int i = 0; i < buttons.length; i++) {
- if(buttons[i] == button)
+ if (buttons[i] == button)
return i;
}
@@ -76,7 +76,7 @@ namespace Usage {
var button_number = 0;
for(int i = 1; i < buttons.length; i++) {
this.sub_views[i].get_allocation(out alloc);
- if(y < alloc.y)
+ if (y < alloc.y)
break;
button_number = i;
}
diff --git a/src/graph-switcher-button.vala b/src/graph-switcher-button.vala
index 5669f27..5a4e71c 100644
--- a/src/graph-switcher-button.vala
+++ b/src/graph-switcher-button.vala
@@ -52,7 +52,7 @@ namespace Usage {
}
construct {
- if(_group == null)
+ if (_group == null)
_group = this;
else
join_group(_group);
diff --git a/src/memory-graph-model.vala b/src/memory-graph-model.vala
index 4a4a8c0..50f334f 100644
--- a/src/memory-graph-model.vala
+++ b/src/memory-graph-model.vala
@@ -49,24 +49,24 @@ namespace Usage {
SystemMonitor monitor = SystemMonitor.get_default();
double ram_usage = 0;
- if(monitor.ram_total != 0)
+ if (monitor.ram_total != 0)
ram_usage = (((double) monitor.ram_usage / monitor.ram_total) * 100);
double swap_usage = 0;
- if(monitor.ram_total != 0)
+ if (monitor.ram_total != 0)
swap_usage = (((double) monitor.swap_usage / monitor.swap_total) * 100);
iter_set_value(iter, COLUMN_RAM, ram_usage);
iter_set_value(iter, COLUMN_SWAP, swap_usage);
- if(ram_usage >= 90) {
- if(change_big_ram_usage) {
+ if (ram_usage >= 90) {
+ if (change_big_ram_usage) {
big_ram_usage();
change_big_ram_usage = false;
change_small_ram_usage = true;
}
} else {
- if(change_small_ram_usage) {
+ if (change_small_ram_usage) {
small_ram_usage();
change_small_ram_usage = false;
change_big_ram_usage = true;
diff --git a/src/memory-graph.vala b/src/memory-graph.vala
index 3b4b1da..18b9615 100644
--- a/src/memory-graph.vala
+++ b/src/memory-graph.vala
@@ -46,7 +46,7 @@ namespace Usage {
color_normal = get_style_context().get_color(get_style_context().get_state());
get_style_context().remove_class("stacked");
- if(graph_model == null) {
+ if (graph_model == null) {
graph_model = new MemoryGraphModel();
set_model(graph_model);
} else {
diff --git a/src/memory-sub-view.vala b/src/memory-sub-view.vala
index 4382f00..45d9031 100644
--- a/src/memory-sub-view.vala
+++ b/src/memory-sub-view.vala
@@ -59,7 +59,7 @@ namespace Usage {
var system_monitor = SystemMonitor.get_default();
system_monitor.notify["process-list-ready"].connect ((sender, property) => {
- if(system_monitor.process_list_ready) {
+ if (system_monitor.process_list_ready) {
memory_box.pack_start(process_list_box, false, false, 0);
memory_box.remove(spinner);
} else {
diff --git a/src/pie-chart.vala b/src/pie-chart.vala
index e65d95c..f94eff0 100644
--- a/src/pie-chart.vala
+++ b/src/pie-chart.vala
@@ -47,7 +47,7 @@ namespace Usage {
double ratio;
double angle2 = - Math.PI / 2.0;
- if(used_percentages > 0) {
+ if (used_percentages > 0) {
angle1 = - Math.PI / 2.0;
ratio = (double) used_percentages / 100;
angle2 = ratio * 2 * Math.PI - Math.PI / 2.0;
@@ -57,7 +57,7 @@ namespace Usage {
context.fill();
}
- if(other_percentages > 0) {
+ if (other_percentages > 0) {
angle1 = angle2;
ratio = (double) other_percentages / 100;
angle2 = ratio * 2 * Math.PI - Math.PI / 2.0;
diff --git a/src/process-list-box.vala b/src/process-list-box.vala
index f88f967..b191ee1 100644
--- a/src/process-list-box.vala
+++ b/src/process-list-box.vala
@@ -52,7 +52,7 @@ namespace Usage {
var system_monitor = SystemMonitor.get_default();
system_monitor.notify["process-list-ready"].connect (() => {
- if(system_monitor.process_list_ready)
+ if (system_monitor.process_list_ready)
update();
});
@@ -79,24 +79,24 @@ namespace Usage {
};
var system_monitor = SystemMonitor.get_default();
- if(search_text == "") {
+ if (search_text == "") {
switch(type) {
default:
case ProcessListBoxType.PROCESSOR:
foreach(unowned AppItem app in system_monitor.get_apps()) {
- if(app.cpu_load > APP_CPU_MIN_LOAD_LIMIT)
+ if (app.cpu_load > APP_CPU_MIN_LOAD_LIMIT)
model.insert_sorted(app, app_cmp);
}
break;
case ProcessListBoxType.MEMORY:
foreach(unowned AppItem app in system_monitor.get_apps())
- if(app.mem_usage > APP_MEM_MIN_USAGE_LIMIT)
+ if (app.mem_usage > APP_MEM_MIN_USAGE_LIMIT)
model.insert_sorted(app, app_cmp);
break;
}
} else {
foreach(unowned AppItem app in system_monitor.get_apps()) {
- if(app.display_name.down().contains(search_text.down()) ||
app.representative_cmdline.down().contains(search_text.down()))
+ if (app.display_name.down().contains(search_text.down()) ||
app.representative_cmdline.down().contains(search_text.down()))
model.insert_sorted(app, app_cmp);
}
}
@@ -110,7 +110,7 @@ namespace Usage {
}
private void update_header(Gtk.ListBoxRow row, Gtk.ListBoxRow? before_row) {
- if(before_row == null) {
+ if (before_row == null) {
row.set_header(null);
} else {
var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
diff --git a/src/process-row.vala b/src/process-row.vala
index e8bb7bd..2b6db20 100644
--- a/src/process-row.vala
+++ b/src/process-row.vala
@@ -91,11 +91,11 @@ namespace Usage {
private void create_user_tag() {
string class_name = "";
- if(app.user.LocalAccount) {
+ if (app.user.LocalAccount) {
class_name = CSS_TAG_USER;
- } else if(app.user.AccountType == UserAccountType.ADMINISTRATOR) {
+ } else if (app.user.AccountType == UserAccountType.ADMINISTRATOR) {
class_name = CSS_TAG_ROOT;
- } else if(app.user.SystemAccount) {
+ } else if (app.user.SystemAccount) {
class_name = CSS_TAG_SYSTEM;
}
diff --git a/src/process.vala b/src/process.vala
index 7bdb4e8..538724a 100644
--- a/src/process.vala
+++ b/src/process.vala
@@ -68,7 +68,7 @@ namespace Usage {
break;
}
- if(cpu_load > 0)
+ if (cpu_load > 0)
status = ProcessStatus.RUNNING;
mark_as_updated = true;
diff --git a/src/storage/storage-actionbar.vala b/src/storage/storage-actionbar.vala
index e21f702..ba46758 100644
--- a/src/storage/storage-actionbar.vala
+++ b/src/storage/storage-actionbar.vala
@@ -46,9 +46,9 @@ namespace Usage {
Gtk.MessageType.WARNING, Gtk.ButtonsType.OK_CANCEL, display_message);
dialog.secondary_text = _("If you delete these items, they will be permanently lost.");
- if(dialog.run() == Gtk.ResponseType.OK) {
+ if (dialog.run() == Gtk.ResponseType.OK) {
foreach(var item in selected_items) {
- if(item.type == FileType.DIRECTORY && item.custom_type == StorageViewType.ROOT_ITEM)
+ if (item.type == FileType.DIRECTORY && item.custom_type == StorageViewType.ROOT_ITEM)
delete_file(item.uri, false);
else
delete_file(item.uri, true);
@@ -63,7 +63,7 @@ namespace Usage {
var type = file.query_file_type (FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
try {
- if(type == FileType.DIRECTORY) {
+ if (type == FileType.DIRECTORY) {
FileInfo info;
FileEnumerator enumerator = file.enumerate_children("standard::*",
FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
@@ -73,7 +73,7 @@ namespace Usage {
}
}
- if(delete_basefile)
+ if (delete_basefile)
file.delete();
}
catch (Error e) {
diff --git a/src/storage/storage-graph.vala b/src/storage/storage-graph.vala
index 89d35b4..efba041 100644
--- a/src/storage/storage-graph.vala
+++ b/src/storage/storage-graph.vala
@@ -35,9 +35,9 @@ namespace Usage {
this.queue_draw ();
root = false;
- for(int i = 0; i < value.get_n_items(); i++) {
+ for (int i = 0; i < value.get_n_items(); i++) {
var item = model.get_item(i) as StorageViewItem;
- if(item.custom_type == StorageViewType.OS) {
+ if (item.custom_type == StorageViewType.OS) {
root = true;
break;
}
@@ -76,26 +76,26 @@ namespace Usage {
var background_color =
get_toplevel().get_style_context().get_background_color(get_toplevel().get_style_context().get_state());
var foreground_color = get_style_context().get_color(get_style_context().get_state());
- for(int i = 1; i < model.get_n_items(); i++) {
+ for (int i = 1; i < model.get_n_items(); i++) {
var item = (model.get_item(i) as StorageViewItem);
- if(i > 0 && i < 3 && (item.percentage < min_percentage_shown_files)) {
+ if (i > 0 && i < 3 && (item.percentage < min_percentage_shown_files)) {
shown_items_number = model.get_n_items();
continue;
}
- if(item.percentage > min_percentage_shown_files)
+ if (item.percentage > min_percentage_shown_files)
shown_items_number = shown_items_number + 1;
}
- if(shown_items_number > 1) {
- if(shown_items_number < 3)
+ if (shown_items_number > 1) {
+ if (shown_items_number < 3)
shown_items_number = 3;
- for(int i = 0; i < model.get_n_items(); i++) {
+ for (int i = 0; i < model.get_n_items(); i++) {
var item = model.get_item(i) as StorageViewItem;
var item_radius = radius;
- if(item.custom_type == StorageViewType.UP_FOLDER || item.size == 0)
+ if (item.custom_type == StorageViewType.UP_FOLDER || item.size == 0)
continue;
var style_context = get_style_context();
@@ -105,24 +105,24 @@ namespace Usage {
Gdk.RGBA fill_color = base_color;
- if(!root) {
+ if (!root) {
fill_color = Utils.generate_color(base_color, i, shown_items_number, true);
item.color = fill_color;
}
- if(selected_items.find(item) != null)
+ if (selected_items.find(item) != null)
item_radius += radius / 6;
context.set_line_width (2.0);
start_angle = final_angle;
- if(item.percentage < 0.3)
+ if (item.percentage < 0.3)
ratio = ratio + ((double) 0.3 / 100);
else
ratio = ratio + ((double) item.percentage / 100);
final_angle = ratio * 2 * Math.PI - Math.PI / 2.0;
- if(final_angle >= (2 * Math.PI - Math.PI / 2.0))
+ if (final_angle >= (2 * Math.PI - Math.PI / 2.0))
final_angle = 2 * Math.PI - Math.PI / 2.0;
context.move_to (x, y);
@@ -133,7 +133,7 @@ namespace Usage {
Gdk.cairo_set_source_rgba (context, foreground_color);
context.stroke();
- if(start_angle >= (2 * Math.PI - Math.PI / 2.0))
+ if (start_angle >= (2 * Math.PI - Math.PI / 2.0))
break;
}
@@ -169,7 +169,7 @@ namespace Usage {
}
private void draw_selected_size_text(Cairo.Context context) {
- if(selected_size == 0)
+ if (selected_size == 0)
return;
var layout = create_pango_layout (null);
diff --git a/src/storage/storage-view-item.vala b/src/storage/storage-view-item.vala
index 0a52a68..4a5c3a0 100644
--- a/src/storage/storage-view-item.vala
+++ b/src/storage/storage-view-item.vala
@@ -122,7 +122,7 @@ public class Usage.StorageViewItem : GLib.Object {
break;
}
- if(custom_type != StorageViewType.NONE) {
+ if (custom_type != StorageViewType.NONE) {
switch(custom_type) {
case StorageViewType.OS:
style_class = "os-tag";
@@ -138,7 +138,7 @@ public class Usage.StorageViewItem : GLib.Object {
}
private bool _show_check_button () {
- if(custom_type != StorageViewType.NONE) {
+ if (custom_type != StorageViewType.NONE) {
switch(custom_type) {
case StorageViewType.OS:
case StorageViewType.AVAILABLE_GRAPH:
diff --git a/src/storage/storage-view-row.vala b/src/storage/storage-view-row.vala
index b72253f..18bf28d 100644
--- a/src/storage/storage-view-row.vala
+++ b/src/storage/storage-view-row.vala
@@ -87,16 +87,16 @@ public class Usage.StorageViewRow : Gtk.ListBoxRow {
if (item.type == FileType.DIRECTORY || item.custom_type != StorageViewType.NONE)
tag.width_request = tag.height_request = 20;
- if(item.custom_type == StorageViewType.UP_FOLDER) {
+ if (item.custom_type == StorageViewType.UP_FOLDER) {
get_style_context().add_class("up-folder");
- if(!item.loaded) {
+ if (!item.loaded) {
spinner.visible = true;
size_label.visible = false;
}
item.notify["loaded"].connect(() => {
- if(item.loaded) {
+ if (item.loaded) {
spinner.visible = false;
size_label.visible = true;
}
diff --git a/src/storage/storage-view.vala b/src/storage/storage-view.vala
index fbdfd31..35d2bb7 100644
--- a/src/storage/storage-view.vala
+++ b/src/storage/storage-view.vala
@@ -93,7 +93,7 @@ public class Usage.StorageView : Usage.View {
stack_listbox_up();
clear_selected_items();
- if(listbox.get_depth() >= 1) {
+ if (listbox.get_depth() >= 1) {
selected_items_stack.push_head((owned) selected_items);
actual_item.push_head(item);
present_dir.begin (item.uri, item.dir, cancellable);
@@ -120,7 +120,7 @@ public class Usage.StorageView : Usage.View {
cancellable.cancel();
cancellable = new Cancellable();
- if(storage_row.item.custom_type == StorageViewType.UP_FOLDER) {
+ if (storage_row.item.custom_type == StorageViewType.UP_FOLDER) {
stack_listbox_up();
} else if (storage_row.item.type == FileType.DIRECTORY) {
selected_items_stack.push_head((owned) selected_items);
@@ -147,18 +147,18 @@ public class Usage.StorageView : Usage.View {
var first_item = listbox.get_model().get_item(0) as StorageViewItem;
var refresh = false;
- if(need_refresh_depth >= listbox.get_depth()) {
+ if (need_refresh_depth >= listbox.get_depth()) {
need_refresh_depth -= 1;
refresh = true;
}
- if(listbox.get_depth() > 1 && first_item.loaded == false || refresh) {
+ if (listbox.get_depth() > 1 && first_item.loaded == false || refresh) {
var item = actual_item.peek_head();
clear_selected_items();
listbox.pop();
- if(listbox.get_depth() == 0)
+ if (listbox.get_depth() == 0)
populate_view.begin ();
else
present_dir.begin (item.uri, item.dir, cancellable);
@@ -176,11 +176,11 @@ public class Usage.StorageView : Usage.View {
var row = new StorageViewRow.from_item (item);
row.visible = true;
- if(selected_items.find(item) != null)
+ if (selected_items.find(item) != null)
row.check_button.active = true;
row.check_button_toggled.connect(() => {
- if(row.selected)
+ if (row.selected)
selected_items.append(row.item);
else
selected_items.remove(row.item);
@@ -188,7 +188,7 @@ public class Usage.StorageView : Usage.View {
refresh_actionbar();
});
- if(item.custom_type == StorageViewType.AVAILABLE_GRAPH)
+ if (item.custom_type == StorageViewType.AVAILABLE_GRAPH)
return new Gtk.ListBoxRow();
graph.model = (ListStore) listbox.get_model();
@@ -208,7 +208,7 @@ public class Usage.StorageView : Usage.View {
controller.set_model(model);
controller.enumerate_children.begin(uri, dir, cancellable, (obj, res) => {
- if(!cancellable.is_cancelled()) {
+ if (!cancellable.is_cancelled()) {
var up_folder_item = model.get_item(0) as StorageViewItem;
up_folder_item.size = controller.enumerate_children.end(res);
up_folder_item.loaded = true;
@@ -217,7 +217,7 @@ public class Usage.StorageView : Usage.View {
});
listbox.push (new Gtk.ListBoxRow(), model, create_file_row);
- if(!cancellable.is_cancelled())
+ if (!cancellable.is_cancelled())
graph.model = model;
}
@@ -292,7 +292,7 @@ public class Usage.StorageView : Usage.View {
model.insert (1, item);
items_loaded++;
- if(items_loaded == xdg_folders.length)
+ if (items_loaded == xdg_folders.length)
loading_notification.dismiss();
} catch (GLib.Error error) {
warning (error.message);
@@ -314,7 +314,7 @@ public class Usage.StorageView : Usage.View {
actionbar.update_selected_items(selected_items);
graph.update_selected_items(selected_items);
- if(selected_items.length() == 0)
+ if (selected_items.length() == 0)
actionbar.hide();
else
actionbar.show();
diff --git a/src/storage/tracker-controller.vala b/src/storage/tracker-controller.vala
index 89697c4..f7d5fb6 100644
--- a/src/storage/tracker-controller.vala
+++ b/src/storage/tracker-controller.vala
@@ -53,11 +53,11 @@ public class Usage.TrackerController : GLib.Object {
parent_size = yield get_file_size (uri);
while (yield worker.fetch_next (out n_uri, out file_type)) {
- if(!cancellable.is_cancelled()) {
+ if (!cancellable.is_cancelled()) {
var file = File.new_for_uri (n_uri);
var item = StorageViewItem.from_file (file);
- if(item == null)
+ if (item == null)
continue;
item.ontology = file_type;
diff --git a/src/system-monitor.vala b/src/system-monitor.vala
index 6bd38b4..b87676a 100644
--- a/src/system-monitor.vala
+++ b/src/system-monitor.vala
@@ -78,7 +78,7 @@ namespace Usage {
app_table.remove_all();
process_list_ready = false;
- if(group_system_apps) {
+ if (group_system_apps) {
var system = new AppItem.system();
app_table.insert("system" , system);
}
diff --git a/src/utils.vala b/src/utils.vala
index add1663..437bf88 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -21,26 +21,26 @@
namespace Usage {
public class Utils {
public static string format_size_values(uint64 value) {
- if(value >= 1000000000000)
+ if (value >= 1000000000000)
return "%.3f TB".printf((double) value / 1000000000000d);
- else if(value >= 1000000000)
+ else if (value >= 1000000000)
return "%.1f GB".printf((double) value / 1000000000d);
- else if(value >= 1000000)
+ else if (value >= 1000000)
return(value / 1000000).to_string() + " MB";
- else if(value >= 1000)
+ else if (value >= 1000)
return (value / 1000).to_string() + " KB";
else
return value.to_string() + " B";
}
public static string format_size_speed_values(uint64 value) {
- if(value >= 1000000000000)
+ if (value >= 1000000000000)
return "%.3f TB/s".printf((double) value / 1000000000000d);
- else if(value >= 1000000000)
+ else if (value >= 1000000000)
return "%.1f GB/s".printf((double) value / 1000000000d);
- else if(value >= 1000000)
+ else if (value >= 1000000)
return "%.2f MB/s".printf((double) value / 1000000d);
- else if(value >= 1000)
+ else if (value >= 1000)
return (value / 1000).to_string() + " KB/s";
else
return value.to_string() + " B/s";
@@ -50,18 +50,18 @@ namespace Usage {
double step = 100 / (double) all_count;
uint half_count = all_count / 2;
- if(order >= all_count)
+ if (order >= all_count)
order = all_count - 1;
- if(order > (all_count / 2)) {
+ if (order > (all_count / 2)) {
double percentage = step * (order - half_count);
- if(reverse)
+ if (reverse)
return Utils.color_lighter(default_color, percentage);
else
return Utils.color_darker(default_color, percentage);
} else {
double percentage = step * (half_count - (order-1));
- if(reverse)
+ if (reverse)
return Utils.color_darker(default_color, percentage);
else
return Utils.color_lighter(default_color, percentage);
diff --git a/src/window.vala b/src/window.vala
index 537889e..07fd2ae 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -55,7 +55,7 @@ namespace Usage {
public Window(Gtk.Application application) {
GLib.Object(application : application);
- if(Config.PROFILE == "Devel") {
+ if (Config.PROFILE == "Devel") {
get_style_context().add_class("devel");
}
@@ -130,9 +130,9 @@ namespace Usage {
[GtkCallback]
private void on_visible_child_changed() {
- if(stack.visible_child_name == views[Views.PERFORMANCE].name) {
+ if (stack.visible_child_name == views[Views.PERFORMANCE].name) {
set_mode(HeaderBarMode.PERFORMANCE);
- } else if(stack.visible_child_name == views[Views.STORAGE].name) {
+ } else if (stack.visible_child_name == views[Views.STORAGE].name) {
set_mode(HeaderBarMode.STORAGE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]