[gnome-applets/wip/muktupavels/async-command: 3/5] command: change interval and width type to unsigned int



commit 55e2c367e8a60a3f11e282d44ee504f61b5ab2e3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Mar 23 21:33:29 2020 +0200

    command: change interval and width type to unsigned int

 .../org.gnome.gnome-applets.command.gschema.xml.in.in    |  4 ++--
 command/src/command.c                                    | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 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 a54e04974..bf35fb4e7 100644
--- a/command/org.gnome.gnome-applets.command.gschema.xml.in.in
+++ b/command/org.gnome.gnome-applets.command.gschema.xml.in.in
@@ -5,13 +5,13 @@
       <_summary>Command to execute</_summary>
       <_description>Command/script to execute to get the output</_description>
     </key>
-    <key name="interval" type="i">
+    <key name="interval" type="u">
       <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">
+    <key name="width" type="u">
       <range min="1" max="100"/>
       <default>60</default>
       <_summary>Width of output</_summary>
diff --git a/command/src/command.c b/command/src/command.c
index a231419d4..eb035e5f4 100644
--- a/command/src/command.c
+++ b/command/src/command.c
@@ -60,8 +60,8 @@ typedef struct
     GtkBox            *box;
 
     gchar             *command;
-    gint               interval;
-    gint               width;
+    guint              interval;
+    guint              width;
 
     guint              timeout_id;
 } CommandApplet;
@@ -210,9 +210,9 @@ settings_command_changed (GSettings *settings, gchar *key, CommandApplet *comman
 static void
 settings_width_changed (GSettings *settings, gchar *key, CommandApplet *command_applet)
 {
-    gint width;
+    guint width;
 
-    width = g_settings_get_int (command_applet->settings, WIDTH_KEY);
+    width = g_settings_get_uint (command_applet->settings, WIDTH_KEY);
 
     command_applet->width = width;
 
@@ -223,9 +223,9 @@ settings_width_changed (GSettings *settings, gchar *key, CommandApplet *command_
 static void
 settings_interval_changed (GSettings *settings, gchar *key, CommandApplet *command_applet)
 {
-    gint interval;
+    guint interval;
 
-    interval = g_settings_get_int (command_applet->settings, INTERVAL_KEY);
+    interval = g_settings_get_uint (command_applet->settings, INTERVAL_KEY);
 
     command_applet->interval = interval;
 
@@ -325,9 +325,9 @@ command_applet_fill (PanelApplet* applet)
     command_applet->applet = applet;
     command_applet->settings = panel_applet_settings_new (applet, COMMAND_SCHEMA);
 
-    command_applet->interval = g_settings_get_int (command_applet->settings, INTERVAL_KEY);
+    command_applet->interval = g_settings_get_uint (command_applet->settings, INTERVAL_KEY);
     command_applet->command = g_settings_get_string (command_applet->settings, COMMAND_KEY);
-    command_applet->width = g_settings_get_int (command_applet->settings, WIDTH_KEY);
+    command_applet->width = g_settings_get_uint (command_applet->settings, WIDTH_KEY);
 
     command_applet->box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
     command_applet->image = GTK_IMAGE (gtk_image_new_from_icon_name (APPLET_ICON, 24));


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