summaryrefslogtreecommitdiff
path: root/time/gnotime/patches/patch-ai
diff options
context:
space:
mode:
Diffstat (limited to 'time/gnotime/patches/patch-ai')
-rw-r--r--time/gnotime/patches/patch-ai103
1 files changed, 103 insertions, 0 deletions
diff --git a/time/gnotime/patches/patch-ai b/time/gnotime/patches/patch-ai
new file mode 100644
index 00000000000..a2ad924750f
--- /dev/null
+++ b/time/gnotime/patches/patch-ai
@@ -0,0 +1,103 @@
+$NetBSD: patch-ai,v 1.1 2004/11/24 22:35:25 kristerw Exp $
+
+--- src/prefs.c.orig Wed Nov 24 22:35:57 2004
++++ src/prefs.c Wed Nov 24 22:40:01 2004
+@@ -199,11 +199,12 @@
+ static int
+ scan_time_string (const char *str)
+ {
++ char * p;
+ int hours=0, minutes=0, seconds = 0;
+ char buff[24];
+ strncpy (buff, str, 24);
+ buff[23]=0;
+- char * p = strchr (buff, ':');
++ p = strchr (buff, ':');
+ if (p) *p = 0;
+ hours = atoi (buff);
+ if (p)
+@@ -221,9 +222,11 @@
+ minutes %= 60;
+ hours %= 24;
+
++ {
+ int totalsecs = hours*3600 + minutes*60 + seconds;
+ if (12*3600 < totalsecs) totalsecs -= 24*3600;
+ return totalsecs;
++ }
+ }
+
+ /* ============================================================== */
+@@ -372,15 +375,17 @@
+
+ if (5 == page)
+ {
++ int off, day;
++ const char * buff;
+ int change = 0;
+ config_idle_timeout = atoi(gtk_entry_get_text(GTK_ENTRY(odlg->idle_secs)));
+
+ /* Hunt for the hour-of night on which to start */
+- const char * buff = gtk_entry_get_text (odlg->daystart_secs);
+- int off = scan_time_string (buff);
++ buff = gtk_entry_get_text (odlg->daystart_secs);
++ off = scan_time_string (buff);
+ SET_VAL (config_daystart_offset,off);
+
+- int day = get_optionmenu_item (odlg->weekstart_menu);
++ day = get_optionmenu_item (odlg->weekstart_menu);
+ SET_VAL (config_weekstart_offset, day);
+
+ if (change)
+@@ -420,6 +425,8 @@
+ static void
+ options_dialog_set(PrefsDialog *odlg)
+ {
++ int hour, day, secs;
++ char buff[24];
+ char s[30];
+
+ SET_ACTIVE(secs);
+@@ -495,7 +502,6 @@
+ gtk_entry_set_text(GTK_ENTRY(odlg->idle_secs), s);
+
+ /* Set the correct menu item based on current values */
+- int hour;
+ if (0<config_daystart_offset)
+ {
+ hour = (config_daystart_offset +1800)/3600;
+@@ -510,14 +516,13 @@
+ set_optionmenu_item (odlg->daystart_menu, hour);
+
+ /* Print the daystart offset as a string in 24 hour time */
+- int secs = config_daystart_offset;
++ secs = config_daystart_offset;
+ if (0 > secs) secs += 24*3600;
+- char buff[24];
+ qof_print_hours_elapsed_buff (buff, 24, secs, config_show_secs);
+ gtk_entry_set_text (odlg->daystart_secs, buff);
+
+ /* Set the correct menu item based on current values */
+- int day = config_weekstart_offset;
++ day = config_weekstart_offset;
+ set_optionmenu_item (odlg->weekstart_menu, day);
+
+ /* set to unmodified as it reflects the current state of the app */
+@@ -529,14 +534,15 @@
+ static void
+ daystart_menu_changed (gpointer data, GtkOptionMenu *w)
+ {
++ int secs;
++ char buff[24];
+ PrefsDialog *dlg = data;
+
+ int hour = get_optionmenu_item (dlg->daystart_menu);
+ hour += -3; /* menu starts at 9PM */
+
+- int secs = hour * 3600;
++ secs = hour * 3600;
+ if (0 > secs) secs += 24*3600;
+- char buff[24];
+ qof_print_hours_elapsed_buff (buff, 24, secs, config_show_secs);
+ gtk_entry_set_text (dlg->daystart_secs, buff);
+ }