[gnome-applets/wip/muktupavels/async-command: 2/5] command: add range for interval and width settings



commit 3f4154d587c687b1e0d47771372e62b326f9c80d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Mar 23 21:32:01 2020 +0200

    command: add range for interval and width settings

 command/org.gnome.gnome-applets.command.gschema.xml.in.in | 2 ++
 command/src/command.c                                     | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/command/org.gnome.gnome-applets.command.gschema.xml.in.in 
b/command/org.gnome.gnome-applets.command.gschema.xml.in.in
index 4c30bb8c7..a54e04974 100644
--- a/command/org.gnome.gnome-applets.command.gschema.xml.in.in
+++ b/command/org.gnome.gnome-applets.command.gschema.xml.in.in
@@ -6,11 +6,13 @@
       <_description>Command/script to execute to get the output</_description>
     </key>
     <key name="interval" type="i">
+      <range min="1" max="600"/>
       <default>1</default>
       <_summary>Interval for the command</_summary>
       <_description>Interval to execute the command (in seconds)</_description>
     </key>
     <key name="width" type="i">
+      <range min="1" max="100"/>
       <default>60</default>
       <_summary>Width of output</_summary>
       <_description>Number of characters to display</_description>
diff --git a/command/src/command.c b/command/src/command.c
index a74fe8983..a231419d4 100644
--- a/command/src/command.c
+++ b/command/src/command.c
@@ -227,10 +227,6 @@ settings_interval_changed (GSettings *settings, gchar *key, CommandApplet *comma
 
     interval = g_settings_get_int (command_applet->settings, INTERVAL_KEY);
 
-    /* minimum interval */
-    if (interval < 1)
-        interval = 1;
-
     command_applet->interval = interval;
 
     /* stop current timer */


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