[gnome-system-monitor] Use gsettings to enforce sane update intervals



commit 31295d79b6018b9e2b8819a0968a9469cb9adb3c
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Fri Aug 2 15:47:09 2013 +0200

    Use gsettings to enforce sane update intervals

 src/org.gnome.gnome-system-monitor.gschema.xml.in |   21 +++++++++------------
 src/procman-app.cpp                               |    5 -----
 2 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/src/org.gnome.gnome-system-monitor.gschema.xml.in 
b/src/org.gnome.gnome-system-monitor.gschema.xml.in
index b3f60a9..d182804 100644
--- a/src/org.gnome.gnome-system-monitor.gschema.xml.in
+++ b/src/org.gnome.gnome-system-monitor.gschema.xml.in
@@ -51,17 +51,15 @@
     </key>
 
     <key name="update-interval" type="i">
-      <default>3000
-      </default>
-      <_summary>Time in milliseconds between updates of the process view
-      </_summary>
+      <range min="1000" max="100000"/>
+      <default>3000</default>
+      <_summary>Time in milliseconds between updates of the process view</_summary>
     </key>
 
     <key name="graph-update-interval" type="i">
-      <default>1000
-      </default>
-      <_summary>Time in milliseconds between updates of the graphs
-      </_summary>
+      <range min="250" max="100000"/>
+      <default>1000</default>
+      <_summary>Time in milliseconds between updates of the graphs</_summary>
     </key>
 
     <key name="show-all-fs" type="b">
@@ -74,10 +72,9 @@
     </key>
 
     <key name="disks-interval" type="i">
-      <default>5000
-      </default>
-      <_summary>Time in milliseconds between updates of the devices list
-      </_summary>
+      <range min="1000" max="100000"/>
+      <default>5000</default>
+      <_summary>Time in milliseconds between updates of the devices list</_summary>
     </key>
 
     <key name="show-whose-processes" type="s">
diff --git a/src/procman-app.cpp b/src/procman-app.cpp
index b522ba5..fd063c8 100644
--- a/src/procman-app.cpp
+++ b/src/procman-app.cpp
@@ -287,11 +287,6 @@ ProcmanApp::load_settings()
                       G_CALLBACK(color_changed_cb), this);
     gdk_rgba_parse(&config.net_out_color, color);
     g_free (color);
-
-    /* Sanity checks */
-    config.update_interval = MAX (config.update_interval, 1000);
-    config.graph_update_interval = MAX (config.graph_update_interval, 250);
-    config.disks_update_interval = MAX (config.disks_update_interval, 1000);
 }
 
 ProcmanApp::ProcmanApp() : Gtk::Application("org.gnome.SystemMonitor", Gio::APPLICATION_HANDLES_COMMAND_LINE)


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