summaryrefslogtreecommitdiff
path: root/time/gnotime/patches/patch-ae
blob: 16705e2b81c6996acb2bc171b31b572606e7dcd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
$NetBSD: patch-ae,v 1.1 2004/11/24 22:35:25 kristerw Exp $

--- src/journal.c.orig	Wed Nov 24 22:18:52 2004
+++ src/journal.c	Wed Nov 24 22:26:45 2004
@@ -195,11 +195,12 @@
 static void 
 save_to_gnomevfs (Wiggy *wig, const char * filename)
 {
-
+	gboolean exists;
+	GnomeVFSResult    result;
 	/* Don't clobber the file, ask user for permission */
 	GnomeVFSURI *parsed_uri;
 	parsed_uri = gnome_vfs_uri_new  (filename);
-	gboolean exists = gnome_vfs_uri_exists (parsed_uri);
+	exists = gnome_vfs_uri_exists (parsed_uri);
 	gnome_vfs_uri_unref (parsed_uri);
 	if (exists)
 	{
@@ -215,7 +216,6 @@
 	}
 		
 	/* Try to open the file for writing */
-	GnomeVFSResult    result;
 	result = gnome_vfs_create (&wig->handle, filename, 
 	                     GNOME_VFS_OPEN_WRITE, FALSE, 0644);
 
@@ -509,6 +509,7 @@
 static void
 task_delete_memo_clicked_cb(GtkWidget * w, gpointer data) 
 {
+	GList * ctl;
 	Wiggy *wig = (Wiggy *) data;
 
 	/* It is physically impossible to cut just the memo, without
@@ -517,7 +518,7 @@
 
 	gtt_task_merge_up (wig->task);
 
-	GList * ctl = g_list_prepend(cutted_task_list, wig->task);
+	ctl = g_list_prepend(cutted_task_list, wig->task);
 	gtt_task_remove (wig->task);
 	cutted_task_list = ctl;
 }
@@ -697,10 +698,11 @@
 static void 
 on_close_clicked_cb (GtkWidget *w, gpointer data)
 {
+	GtkWidget *topper;
 	Wiggy *wig = (Wiggy *) data;
 
 	if (NULL == wig->top) return;  /* avoid recursive double-free */
-	GtkWidget *topper = wig->top;   /* avoid recursion */
+	topper = wig->top;   /* avoid recursion */
 	wig->top = NULL;
 	gtk_widget_destroy (topper);
 
@@ -786,19 +788,20 @@
 html_url_requested_cb(GtkHTML *doc, const gchar * url, 
                       GtkHTMLStream *handle, gpointer data) 
 {
+	GnomeVFSResult    result;
+	GnomeVFSHandle   *vfs;
+#define BSZ 16000
+	char buff[BSZ];
+	GnomeVFSFileSize  bytes_read;
+
 	Wiggy *wig = data;
 	const char * path = gtt_ghtml_resolve_path (url, wig->filepath);
 	if (!path) return;
 
-	GnomeVFSResult    result;
-	GnomeVFSHandle   *vfs;
 	result = gnome_vfs_open (&vfs, path, GNOME_VFS_OPEN_READ);
 
 	if (GNOME_VFS_OK != result) return;
 	
-#define BSZ 16000
-	char buff[BSZ];
-	GnomeVFSFileSize  bytes_read; 
 	result = gnome_vfs_read (vfs, buff, BSZ, &bytes_read);
 	while (GNOME_VFS_OK == result)
 	{
@@ -859,8 +862,10 @@
 		return msg;
 	}
 
+	{
 	char * msg = _("Left-click to bring up menu");
 	return g_strdup (msg);
+	}
 }
 
 static gint
@@ -922,8 +927,13 @@
 	/* Create and initialize the hover-help window */
 	if (!wig->hover_help_window)
 	{
+		GtkWindow *wino;
+		GtkWidget *frame;
+		GtkWidget *align;
+		GtkWidget *label;
+		int px=0, py=0, rx=0, ry=0;
 		wig->hover_help_window = gtk_window_new(GTK_WINDOW_POPUP);
-		GtkWindow *wino = GTK_WINDOW (wig->hover_help_window);
+		wino = GTK_WINDOW (wig->hover_help_window);
 		gtk_window_set_decorated (wino, FALSE);
 		gtk_window_set_destroy_with_parent (wino, TRUE);
 		gtk_window_set_transient_for (wino, GTK_WINDOW(wig->top));
@@ -931,19 +941,19 @@
 		gtk_window_set_resizable (wino, FALSE);  /* FALSE to enable auto-resize */
 
 		/* There must be a better way to draw a line around the box ?? */
-		GtkWidget *frame = gtk_frame_new (NULL);
+		frame = gtk_frame_new (NULL);
 		gtk_container_add(GTK_CONTAINER(wino), frame);
 		gtk_container_set_resize_mode (GTK_CONTAINER(frame), GTK_RESIZE_PARENT);
 		gtk_widget_show (frame);
 
 		/* There must be a better way to pad the text all around ?? */
-		GtkWidget *align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+		align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
 		// gtk_alignment_set_padding (GTK_ALIGNMENT(align), 6, 6, 6, 6);
 		gtk_container_add(GTK_CONTAINER(frame), align);
 		gtk_container_set_resize_mode (GTK_CONTAINER(align), GTK_RESIZE_PARENT);
 		gtk_widget_show (align);
 		
-		GtkWidget *label = gtk_label_new ("xxx");
+		label = gtk_label_new ("xxx");
 		wig->hover_label = GTK_LABEL (label);
 		gtk_container_add(GTK_CONTAINER(align), label);
 		gtk_widget_show (label);
@@ -952,7 +962,6 @@
 		gtk_window_set_focus (GTK_WINDOW(wig->top), GTK_WIDGET(wig->html));
 
 		/* Set up in initial default, so later move works. */
-		int px=0, py=0, rx=0, ry=0;
 		gtk_widget_get_pointer (GTK_WIDGET(wig->top), &px, &py);
 		gtk_window_get_position (GTK_WINDOW(wig->top), &rx, &ry);
 		gtk_window_move (wino, rx+px, ry+py);
@@ -1003,25 +1012,28 @@
 perform_form_query (KvpFrame *kvpf)
 {
 	GList *results, *n;
+	char *user_debug;
+	QofSqlQuery *q;
+	char *query_string;
 
 	if (!kvpf) return NULL;
 
 	/* Allow the user to enable form debugging by adding the following html:
 	 * <input type="hidden" name="debug" value="1">
 	 */
-	char *user_debug = kvp_frame_get_string (kvpf, "debug");
+	user_debug = kvp_frame_get_string (kvpf, "debug");
 	if (user_debug)
 	{
 		printf ("Debug: HTML Form Input=%s\n", kvp_frame_to_string (kvpf));
 	}
 
-	QofSqlQuery *q = qof_sql_query_new();
+	q = qof_sql_query_new();
 
 	if (!book) book = qof_book_new();
 	qof_sql_query_set_book (q, book);
 	qof_sql_query_set_kvp (q, kvpf);
 
-	char *query_string = kvp_frame_get_string (kvpf, "query");
+	query_string = kvp_frame_get_string (kvpf, "query");
 	if (!query_string) return NULL;
 	if (0 == query_string[0]) return NULL;