Gentoo Archives: gentoo-commits

From: "Michael Weber (xmw)" <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-misc/gtk-sunlight/files: gtk-sunlight-0.2.1.patch gtk-sunlight-0.2.1-makefile.patch
Date: Wed, 27 Oct 2010 23:25:24
Message-Id: 20101027232517.D080F20054@flycatcher.gentoo.org
1 xmw 10/10/27 23:25:17
2
3 Added: gtk-sunlight-0.2.1.patch
4 gtk-sunlight-0.2.1-makefile.patch
5 Log:
6 Initial import
7 (Portage version: 2.1.8.3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch?rev=1.1&content-type=text/plain
14
15 Index: gtk-sunlight-0.2.1.patch
16 ===================================================================
17 Hop this is felling better now ... Michael Weber
18
19 --- gtk-sunlight-0.2.1/callbacks.c
20 +++ gtk-sunlight-0.2.1callbacks.c
21 @@ -19,6 +19,9 @@
22
23
24 #include "support.h"
25 +#include <glib.h>
26 +#include <glib/gstdio.h>
27 +#include <stdlib.h>
28
29 void button_sensitive (ChData *data, gboolean sensitive);
30 void change_wallpaper (ChData *data);
31 @@ -94,21 +97,21 @@
32
33 void cmd_ok_clicked ( GtkButton *button, ChData *data)
34 {
35 - FILE *file;
36 int time_out;
37 - gchar *contents;
38 + gchar *contents = g_malloc(1002);
39 gchar *fname = g_strconcat(g_get_home_dir(), DIR_PROJECT, "/sunlight_options", NULL);
40
41 gtk_widget_hide(data->main_window);
42
43 /*Saving gi_rd1 and gi_rd2 to a file under DIR_PROJECT*/
44 - sprintf(contents, "%d %d", data->gi_rd1, data->gi_rd2);
45 + snprintf(contents, 1000, "%d %d", data->gi_rd1, data->gi_rd2);
46
47 g_file_set_contents(fname, contents, -1, NULL);
48
49 change_wallpaper (data);
50 time_out = gtk_timeout_add(1800000, (GtkFunction) change_wallpaper, data);
51
52 + g_free(contents);
53 g_free(fname);
54 }
55
56 @@ -118,7 +121,6 @@
57 void
58 change_wallpaper (ChData *data)
59 {
60 - FILE *file;
61 gchar *text1, *text2, *image_address, *set_wallpaper;
62 gchar *dir_wallpapers = g_strconcat(g_get_home_dir(), DIR_WALLPAPERS, NULL);
63 gchar *dir_project = g_strconcat(g_get_home_dir(), DIR_PROJECT, NULL);
64 @@ -183,7 +185,6 @@
65 void
66 chk_startup_toggled_cb (GtkToggleButton *togglebutton, ChData *data)
67 {
68 - FILE *file;
69 gchar *contents = "[Desktop Entry]\nEncoding=UTF-8\nIcon=/usr/share/icons/hicolor/48x48/apps/gtk-sunlight.png\nName=Real-time Sunlight Wallpaper\nComment=World sunlight map every 30 minutes\nExec=gtk-sunlight --nodisplay\nTerminal=false\nType=Application\nCategories=Utility;\nStartupNotify=false\nHidden=false\nNoDisplay=false";
70 gchar *path_startup = g_strconcat(g_get_home_dir(), "/.config/autostart/", NULL);
71
72 --- gtk-sunlight-0.2.1/sunlight.c
73 +++ gtk-sunlight-0.2.1/sunlight.c
74 @@ -20,9 +20,15 @@
75 #include "support.h"
76 #include "errno.h"
77 //#include "time.h"
78 +#include <glib.h>
79 +#include <glib/gstdio.h>
80 +#include <stdlib.h>
81 +#include <ctype.h>
82
83 #define UI_FILE "/usr/share/sunlight/sunlight.glade"
84
85 +void change_wallpaper (ChData *data);
86 +
87 gboolean
88 make_dir(gchar *trail)
89 {
90 @@ -78,7 +84,7 @@
91 GError *error = NULL;
92 gchar *option_file = g_strconcat(g_get_home_dir(), DIR_PROJECT, "/sunlight_options", NULL);
93 gchar *contents;
94 - gint length;
95 + gsize length;
96 int time_out;
97
98 GOptionContext *context;
99 @@ -111,8 +117,8 @@
100 data = g_slice_new( ChData );
101
102 /* create project directories if necessary */
103 - if (!make_dir(DIR_PROJECT)) return;
104 - if (!make_dir(DIR_WALLPAPERS)) return;
105 + if (!make_dir(DIR_PROJECT)) return 1;
106 + if (!make_dir(DIR_WALLPAPERS)) return 1;
107
108 /* Check for sunlight_options file and getting gi_rd1 and gi_rd2*/
109 if (g_file_test(option_file, G_FILE_TEST_EXISTS)){
110
111
112
113 1.1 app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch
114
115 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch?rev=1.1&view=markup
116 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch?rev=1.1&content-type=text/plain
117
118 Index: gtk-sunlight-0.2.1-makefile.patch
119 ===================================================================
120 --- makefile 2010-10-05 18:01:14.000000000 +0200
121 +++ /tmp/makefile 2010-10-28 00:29:30.704714980 +0200
122 @@ -1,7 +1,7 @@
123 -CC = gcc
124 +CC ?= gcc
125
126 -CFLAGS = `pkg-config --cflags gtk+-2.0 gmodule-2.0`
127 -LDFLAGS = `pkg-config --libs gtk+-2.0 gmodule-2.0`
128 +CFLAGS += `pkg-config --cflags gtk+-2.0 gmodule-2.0`
129 +LDFLAGS += `pkg-config --libs gtk+-2.0 gmodule-2.0`
130
131 OBJECTS = sunlight.o callbacks.o
132 PROG = gtk-sunlight
133 @@ -10,7 +10,8 @@
134 $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
135
136 install:
137 + install -d -m 0755 $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/icons
138 cp $(PROG) $(DESTDIR)/usr/bin/
139 cp -r sunlight $(DESTDIR)/usr/share/
140 cp -r applications $(DESTDIR)/usr/share/