Merge lp:~ghugesss/xpad/refactor_code into lp:xpad

Proposed by Sagar Ghuge
Status: Merged
Approved by: Arthur Borsboom
Approved revision: 705
Merge reported by: Arthur Borsboom
Merged at revision: not available
Proposed branch: lp:~ghugesss/xpad/refactor_code
Merge into: lp:xpad
Diff against target: 474 lines (+96/-40)
23 files modified
src/fio.c (+5/-1)
src/fio.h (+7/-3)
src/help.c (+4/-1)
src/help.h (+3/-3)
src/prefix.c (+2/-0)
src/prefix.h (+3/-3)
src/xpad-app.c (+11/-8)
src/xpad-grip-tool-item.c (+1/-0)
src/xpad-pad-group.c (+1/-0)
src/xpad-pad-properties.c (+4/-1)
src/xpad-pad.c (+4/-2)
src/xpad-periodic.c (+4/-1)
src/xpad-periodic.h (+7/-3)
src/xpad-preferences.c (+4/-2)
src/xpad-session-manager.c (+6/-3)
src/xpad-session-manager.h (+4/-0)
src/xpad-settings.c (+6/-3)
src/xpad-text-buffer.c (+1/-0)
src/xpad-text-view.c (+3/-1)
src/xpad-toolbar.c (+3/-1)
src/xpad-tray.c (+4/-2)
src/xpad-tray.h (+4/-0)
src/xpad-undo.c (+5/-2)
To merge this branch: bzr merge lp:~ghugesss/xpad/refactor_code
Reviewer Review Type Date Requested Status
Arthur Borsboom Approve
Review via email: mp+245302@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Arthur Borsboom (arthurborsboom) wrote :

All looks good, nice improvement. Xpad is still functioning as expected, so approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/fio.c'
2--- src/fio.c 2014-10-02 22:45:34 +0000
3+++ src/fio.c 2014-12-22 05:35:18 +0000
4@@ -21,13 +21,17 @@
5 */
6
7 #include "../config.h"
8+
9 #include "fio.h"
10+#include "xpad-app.h"
11+
12 #include <stdlib.h>
13 #include <string.h>
14+
15 #include <gio/gio.h>
16 #include <glib/gstdio.h>
17 #include <glib/gi18n.h>
18-#include "xpad-app.h"
19+
20
21 /* Sets filename to full path of filename (prepends xpad_app_get_config_dir ()
22 to it). Returns a GFile representing the file. */
23
24=== modified file 'src/fio.h'
25--- src/fio.h 2014-06-15 10:02:50 +0000
26+++ src/fio.h 2014-12-22 05:35:18 +0000
27@@ -19,11 +19,13 @@
28
29 */
30
31-#ifndef _FIO_H_
32-#define _FIO_H_
33+#ifndef __FIO_H__
34+#define __FIO_H__
35
36 #include <glib.h>
37
38+G_BEGIN_DECLS
39+
40 gchar *fio_get_file (const gchar *name);
41 gboolean fio_set_file (const gchar *name, const gchar *value);
42 void fio_remove_file (const gchar *filename);
43@@ -35,4 +37,6 @@
44
45 gchar *fio_unique_name (const gchar *prefix);
46
47-#endif /* _FIO_H_ */
48+G_END_DECLS
49+
50+#endif /* __FIO_H__ */
51
52=== modified file 'src/help.c'
53--- src/help.c 2014-06-21 11:03:38 +0000
54+++ src/help.c 2014-12-22 05:35:18 +0000
55@@ -20,10 +20,13 @@
56 */
57
58 #include "../config.h"
59+
60 #include "help.h"
61+#include "xpad-app.h"
62+
63 #include <gtk/gtk.h>
64 #include <glib/gi18n.h>
65-#include "xpad-app.h"
66+
67
68 GtkWindow *help_window = NULL;
69
70
71=== modified file 'src/help.h'
72--- src/help.h 2014-06-10 20:55:56 +0000
73+++ src/help.h 2014-12-22 05:35:18 +0000
74@@ -19,9 +19,9 @@
75
76 */
77
78-#ifndef HELP_H
79-#define HELP_H
80+#ifndef __HELP_H__
81+#define __HELP_H__
82
83 void show_help (void);
84
85-#endif
86+#endif /* __HELP_H__ */
87
88=== modified file 'src/prefix.c'
89--- src/prefix.c 2014-10-02 22:45:34 +0000
90+++ src/prefix.c 2014-12-22 05:35:18 +0000
91@@ -44,7 +44,9 @@
92 #endif /* BR_PTHREADS */
93
94 #include "../config.h"
95+
96 #include "prefix.h"
97+
98 #include <stdlib.h>
99 #include <stdio.h>
100 #include <limits.h>
101
102=== modified file 'src/prefix.h'
103--- src/prefix.h 2008-09-21 00:03:40 +0000
104+++ src/prefix.h 2014-12-22 05:35:18 +0000
105@@ -26,8 +26,8 @@
106 * to br_*", try renaming prefix.c to prefix.cpp
107 */
108
109-#ifndef _PREFIX_H_
110-#define _PREFIX_H_
111+#ifndef __PREFIX_H__
112+#define __PREFIX_H__
113
114 #ifdef __cplusplus
115 extern "C" {
116@@ -126,4 +126,4 @@
117 }
118 #endif /* __cplusplus */
119
120-#endif /* _PREFIX_H_ */
121+#endif /* __PREFIX_H__ */
122
123=== modified file 'src/xpad-app.c'
124--- src/xpad-app.c 2014-12-21 13:34:41 +0000
125+++ src/xpad-app.c 2014-12-22 05:35:18 +0000
126@@ -25,15 +25,8 @@
127 Unfortunately, we lose portability... */
128
129 #include "../config.h"
130+
131 #include "xpad-app.h"
132-#include <glib.h>
133-#include <glib/gi18n.h>
134-#include <glib/gstdio.h>
135-#include <string.h>
136-#include <sys/socket.h>
137-#include <sys/un.h>
138-#include <stdio.h>
139-#include <stdlib.h>
140 #include "help.h"
141 #include "xpad-pad.h"
142 #include "xpad-pad-group.h"
143@@ -42,6 +35,16 @@
144 #include "xpad-tray.h"
145 #include "xpad-debug.h"
146
147+#include <string.h>
148+#include <sys/socket.h>
149+#include <sys/un.h>
150+#include <stdio.h>
151+#include <stdlib.h>
152+
153+#include <glib.h>
154+#include <glib/gi18n.h>
155+#include <glib/gstdio.h>
156+
157 /* Seems that some systems (sun-sparc-solaris2.8 at least), need the following three #defines.
158 These were provided by Alan Mizrahi <alan@cesma.usb.ve>.
159 */
160
161=== modified file 'src/xpad-grip-tool-item.c'
162--- src/xpad-grip-tool-item.c 2014-10-02 22:45:34 +0000
163+++ src/xpad-grip-tool-item.c 2014-12-22 05:35:18 +0000
164@@ -20,6 +20,7 @@
165 */
166
167 #include "../config.h"
168+
169 #include "xpad-grip-tool-item.h"
170
171 struct XpadGripToolItemPrivate
172
173=== modified file 'src/xpad-pad-group.c'
174--- src/xpad-pad-group.c 2014-10-02 22:45:34 +0000
175+++ src/xpad-pad-group.c 2014-12-22 05:35:18 +0000
176@@ -21,6 +21,7 @@
177 */
178
179 #include "../config.h"
180+
181 #include "xpad-pad-group.h"
182 #include "xpad-pad.h"
183
184
185=== modified file 'src/xpad-pad-properties.c'
186--- src/xpad-pad-properties.c 2014-10-02 22:45:34 +0000
187+++ src/xpad-pad-properties.c 2014-12-22 05:35:18 +0000
188@@ -20,9 +20,12 @@
189 */
190
191 #include "../config.h"
192+
193 #include "xpad-pad-properties.h"
194+
195+#include <gtk/gtk.h>
196 #include <glib/gi18n.h>
197-#include <gtk/gtk.h>
198+
199
200 struct XpadPadPropertiesPrivate
201 {
202
203=== modified file 'src/xpad-pad.c'
204--- src/xpad-pad.c 2014-12-21 11:25:21 +0000
205+++ src/xpad-pad.c 2014-12-22 05:35:18 +0000
206@@ -24,9 +24,8 @@
207 */
208
209 #include "../config.h"
210+
211 #include "xpad-pad.h"
212-#include <gtk/gtk.h>
213-#include <glib/gi18n.h>
214 #include "fio.h"
215 #include "help.h"
216 #include "xpad-app.h"
217@@ -38,6 +37,9 @@
218 #include "xpad-toolbar.h"
219 #include "xpad-tray.h"
220
221+#include <gtk/gtk.h>
222+#include <glib/gi18n.h>
223+
224 struct XpadPadPrivate
225 {
226 /* saved values */
227
228=== modified file 'src/xpad-periodic.c'
229--- src/xpad-periodic.c 2014-10-02 22:45:34 +0000
230+++ src/xpad-periodic.c 2014-12-22 05:35:18 +0000
231@@ -20,11 +20,14 @@
232 */
233
234 #include "../config.h"
235+
236 #include "xpad-periodic.h"
237-#include <glib/gi18n.h>
238+
239 #include <stdlib.h>
240 #include <string.h>
241
242+#include <glib/gi18n.h>
243+
244 #ifdef SHOW_DEBUG
245 # define G_PRINT_DBG g_print
246 #else
247
248=== modified file 'src/xpad-periodic.h'
249--- src/xpad-periodic.h 2014-06-19 09:08:49 +0000
250+++ src/xpad-periodic.h 2014-12-22 05:35:18 +0000
251@@ -19,11 +19,13 @@
252
253 */
254
255-#ifndef XPAD_PERIODIC_H
256-#define XPAD_PERIODIC_H
257+#ifndef __XPAD_PERIODIC_H__
258+#define __XPAD_PERIODIC_H__
259
260 #include <glib.h>
261
262+G_BEGIN_DECLS
263+
264 typedef void (*XpadPeriodicFunc)(void *);
265
266 /* Callback function codes: save-content, save-info */
267@@ -51,4 +53,6 @@
268 void xpad_periodic_save_content_delayed (void * xpad_pad);
269 void xpad_periodic_save_info_delayed (void * xpad_pad);
270
271-#endif /* XPAD_PERIODIC_H */
272+G_END_DECLS
273+
274+#endif /* __XPAD_PERIODIC_H__ */
275
276=== modified file 'src/xpad-preferences.c'
277--- src/xpad-preferences.c 2014-11-29 18:26:21 +0000
278+++ src/xpad-preferences.c 2014-12-22 05:35:18 +0000
279@@ -20,10 +20,12 @@
280 */
281
282 #include "../config.h"
283+
284 #include "xpad-preferences.h"
285+#include "xpad-app.h"
286+
287+#include <gtk/gtk.h>
288 #include <glib/gi18n.h>
289-#include <gtk/gtk.h>
290-#include "xpad-app.h"
291
292 struct XpadPreferencesPrivate
293 {
294
295=== modified file 'src/xpad-session-manager.c'
296--- src/xpad-session-manager.c 2014-10-02 22:45:34 +0000
297+++ src/xpad-session-manager.c 2014-12-22 05:35:18 +0000
298@@ -22,14 +22,17 @@
299 #ifndef X_DISPLAY_MISSING
300
301 #include "../config.h"
302-#include "xpad-session-manager.h"
303+
304+#include "xpad-session-manager.h"
305+#include "xpad-session-manager.h"
306+#include "xpad-app.h"
307+
308 #include <pwd.h>
309 #include <stdlib.h>
310 #include <string.h>
311+
312 #include <gdk/gdkx.h>
313 #include <X11/SM/SMlib.h>
314-#include "xpad-session-manager.h"
315-#include "xpad-app.h"
316
317 static SmcConn xpad_session_manager_conn = NULL;
318 static int xpad_interact_style;
319
320=== modified file 'src/xpad-session-manager.h'
321--- src/xpad-session-manager.h 2014-06-13 08:31:20 +0000
322+++ src/xpad-session-manager.h 2014-12-22 05:35:18 +0000
323@@ -24,10 +24,14 @@
324
325 #include <glib.h>
326
327+G_BEGIN_DECLS
328+
329 gboolean xpad_session_manager_start_interact (gboolean error);
330 void xpad_session_manager_stop_interact (gboolean stop_shutdown);
331 void xpad_session_manager_init (void);
332 void xpad_session_manager_shutdown (void);
333 void xpad_session_manager_set_id (const gchar *id);
334
335+G_END_DECLS
336+
337 #endif /* __XPAD_SESSION_MANAGER_H__ */
338
339=== modified file 'src/xpad-settings.c'
340--- src/xpad-settings.c 2014-10-02 22:45:34 +0000
341+++ src/xpad-settings.c 2014-12-22 05:35:18 +0000
342@@ -20,13 +20,16 @@
343 */
344
345 #include "../config.h"
346+
347 #include "xpad-settings.h"
348-#include <glib/gi18n.h>
349-#include <gtk/gtk.h>
350-#include <string.h>
351 #include "fio.h"
352 #include "xpad-app.h"
353
354+#include <string.h>
355+
356+#include <gtk/gtk.h>
357+#include <glib/gi18n.h>
358+
359 struct XpadSettingsPrivate
360 {
361 guint width;
362
363=== modified file 'src/xpad-text-buffer.c'
364--- src/xpad-text-buffer.c 2014-10-02 22:56:15 +0000
365+++ src/xpad-text-buffer.c 2014-12-22 05:35:18 +0000
366@@ -21,6 +21,7 @@
367 */
368
369 #include "../config.h"
370+
371 #include "xpad-text-buffer.h"
372 #include "xpad-pad.h"
373 #include "xpad-undo.h"
374
375=== modified file 'src/xpad-text-view.c'
376--- src/xpad-text-view.c 2014-10-02 22:56:15 +0000
377+++ src/xpad-text-view.c 2014-12-22 05:35:18 +0000
378@@ -20,12 +20,14 @@
379 */
380
381 #include "../config.h"
382+
383 #include "xpad-text-view.h"
384-#include <gtk/gtk.h>
385 #include "xpad-text-buffer.h"
386 #include "xpad-pad.h"
387 #include "xpad-toolbar.h"
388
389+#include <gtk/gtk.h>
390+
391 struct XpadTextViewPrivate
392 {
393 gboolean follow_font_style;
394
395=== modified file 'src/xpad-toolbar.c'
396--- src/xpad-toolbar.c 2014-10-02 22:45:34 +0000
397+++ src/xpad-toolbar.c 2014-12-22 05:35:18 +0000
398@@ -20,11 +20,13 @@
399 */
400
401 #include "../config.h"
402+
403 #include "xpad-toolbar.h"
404-#include <glib/gi18n.h>
405 #include "xpad-app.h"
406 #include "xpad-grip-tool-item.h"
407
408+#include <glib/gi18n.h>
409+
410 struct XpadToolbarPrivate
411 {
412 gboolean move_removed;
413
414=== modified file 'src/xpad-tray.c'
415--- src/xpad-tray.c 2014-11-22 12:14:17 +0000
416+++ src/xpad-tray.c 2014-12-22 05:35:18 +0000
417@@ -21,9 +21,8 @@
418 */
419
420 #include "../config.h"
421+
422 #include "xpad-tray.h"
423-#include <gtk/gtk.h>
424-#include <glib/gi18n.h>
425 #include "fio.h"
426 #include "xpad-app.h"
427 #include "xpad-pad.h"
428@@ -31,6 +30,9 @@
429 #include "xpad-preferences.h"
430 #include "xpad-settings.h"
431
432+#include <gtk/gtk.h>
433+#include <glib/gi18n.h>
434+
435 enum
436 {
437 DO_NOTHING,
438
439=== modified file 'src/xpad-tray.h'
440--- src/xpad-tray.h 2014-06-15 10:02:50 +0000
441+++ src/xpad-tray.h 2014-12-22 05:35:18 +0000
442@@ -25,8 +25,12 @@
443
444 #include "xpad-settings.h"
445
446+G_BEGIN_DECLS
447+
448 void xpad_tray_init (XpadSettings *settings);
449 void xpad_tray_dispose (XpadSettings *settings);
450 gboolean xpad_tray_is_open ();
451
452+G_END_DECLS
453+
454 #endif /* __TRAY_H__ */
455
456=== modified file 'src/xpad-undo.c'
457--- src/xpad-undo.c 2014-10-02 22:56:15 +0000
458+++ src/xpad-undo.c 2014-12-22 05:35:18 +0000
459@@ -21,10 +21,13 @@
460 */
461
462 #include "../config.h"
463+
464 #include "xpad-undo.h"
465+#include "xpad-text-buffer.h"
466+
467+#include <stdlib.h>
468+
469 #include <glib.h>
470-#include <stdlib.h>
471-#include "xpad-text-buffer.h"
472
473 struct XpadUndoPrivate
474 {

Subscribers

People subscribed via source and target branches