1 --- gg-1.0.0rel.orig/src/callbacks.c 2003-01-31 10:39:08.000000000 +0100
2 +++ gg-1.0.0rel/src/callbacks.c 2003-06-29 02:51:27.000000000 +0200
5 config.uin = atoi(tmpuin);
6 config.password = g_strdup(tmppass);
8 + if (! write_config()) {
9 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
14 GtkWidget *register_dialog = create_register();
16 void on_zapisz_ustawienia_activate(GtkMenuItem * menuitem,
22 - show_message_dialog("Ustawienia zosta³y zapisane!");
25 + if ((! write_config()) || (! write_contacts()))
26 + show_error_dialog("Nie uda³o siê zapisaæ ustawieñ!");
28 + show_message_dialog("Ustawienia zosta³y zapisane!");
31 void on_dodaj_clicked(GtkButton * button, GtkWidget * dialog)
33 config.away_msg_ask = 0;
37 + if (! write_config())
38 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
41 gtk_widget_destroy(dialog);
43 // FIXME: jaki tu powinien byæ naprawde poprzedni status
44 change_kontakt_status(kontakt, GG_STATUS_OFFLINE);
45 gtk_widget_destroy(edycja);
47 + if (! write_contacts())
48 + show_error_dialog("Nie uda³o siê zapisaæ listy kontaktów!");
50 static void on_ignore_restore(GtkMenuItem * menuitem, guint * uin)
52 @@ -1552,8 +1555,17 @@
53 applet_save_session(GtkWidget * widget,
54 const gchar * privcfgpath, const gchar * globcfgpath)
59 + * Looks like there's no way to indicate that session saving failed.
60 + * At least warn the user if it does fail.
62 + if ((! write_config()) || (! write_contacts())) {
63 + show_error_dialog("Zapisywanie ustawieñ nie uda³o siê."
64 + "Spróbuj usun±æ problem - "
65 + "próba zapisania zostanie ponowiona.");
70 g_print("applet_save_session(): session saved.\n");
72 @@ -1862,11 +1874,15 @@
75 while (fgets(buf, 1024, in)) {
77 + if (fputs(buf, out) == EOF) {
78 + show_error_dialog("Nie uda³o siê zapisaæ ca³ego pliku");
85 + if (fclose(out) == EOF)
86 + show_error_dialog("Nie uda³o siê zapisaæ ca³ego pliku");
89 void on_zapisz_jako_clicked(GtkButton * button, gpointer user_data)
90 diff -ruN gg-1.0.0rel.orig/src/dock.c gg-1.0.0rel/src/dock.c
91 --- gg-1.0.0rel.orig/src/dock.c 2002-11-13 10:33:23.000000000 +0100
92 +++ gg-1.0.0rel/src/dock.c 2003-06-29 02:52:46.000000000 +0200
94 const gchar * privcfgpath,
95 const gchar * globcfgpath)
100 + * Looks like there's no way to indicate that session saving failed.
101 + * At least warn the user if it does fail.
103 + if ((! write_config()) || (! write_contacts())) {
104 + show_error_dialog("Zapisywanie ustawieñ nie uda³o siê."
105 + "Spróbuj usun±æ problem - "
106 + "próba zapisania zostanie ponowiona.");
111 g_print("applet_save_session(): session saved.\n");
113 diff -ruN gg-1.0.0rel.orig/src/gg-types.h gg-1.0.0rel/src/gg-types.h
114 --- gg-1.0.0rel.orig/src/gg-types.h 2003-01-27 12:58:08.000000000 +0100
115 +++ gg-1.0.0rel/src/gg-types.h 2003-06-29 02:58:14.000000000 +0200
118 void read_config(void);
120 -void write_config(void);
121 +int write_config(void);
123 int write_contacts(void);
125 diff -ruN gg-1.0.0rel.orig/src/gg.c gg-1.0.0rel/src/gg.c
126 --- gg-1.0.0rel.orig/src/gg.c 2003-01-27 12:58:08.000000000 +0100
127 +++ gg-1.0.0rel/src/gg.c 2003-06-29 02:56:47.000000000 +0200
133 + if (fclose(fp) == EOF)
134 + show_error_dialog("Nie uda³o siê dopisaæ wiadomo¶ci "
135 + "do historii rozmów.");
138 void gg_recv_msg(GGCmd * cmd)
139 @@ -1142,7 +1144,8 @@
140 show_error_dialog("B³±d podczas zmiany has³a!!!");
142 show_message_dialog("Has³o zosta³o zmienione!");
144 + if (! write_config())
145 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
149 @@ -1227,7 +1230,8 @@
150 show_error_dialog(_("B³±d podczas rejestracji u¿ytkownika"));
152 show_message_dialog(_("Nowy u¿ytkownik zosta³ zarejestrowany"));
154 + if (! write_config())
155 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
159 @@ -1394,7 +1398,8 @@
161 show_message_dialog(tmpline);
162 config.last_sysmsg = strlen(tmpline);
164 + if (! write_config())
165 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
169 @@ -1835,7 +1840,8 @@
170 // fprintf(fp, "%s\n", (r->familycity) ? r->familycity : "");
171 // fprintf(fp, "%s\n", (r->familyname) ? r->familyname : "");
174 + if (fclose(fp) == EOF)
175 + g_warning("Nie uda³o siê zapisaæ katalogu publicznego do pliku!");
179 diff -ruN gg-1.0.0rel.orig/src/gg.h gg-1.0.0rel/src/gg.h
180 --- gg-1.0.0rel.orig/src/gg.h 2003-01-25 16:46:02.000000000 +0100
181 +++ gg-1.0.0rel/src/gg.h 2003-06-29 03:21:10.000000000 +0200
183 void free_contact(GGContact *k);
185 void gg_new_msg_animate_off();
187 \ Brak znaku nowej linii na koñcu pliku
189 diff -ruN gg-1.0.0rel.orig/src/main.c gg-1.0.0rel/src/main.c
190 --- gg-1.0.0rel.orig/src/main.c 2002-12-01 22:17:22.000000000 +0100
191 +++ gg-1.0.0rel/src/main.c 2003-06-29 03:24:33.000000000 +0200
200 path = g_strconcat(config.homedir, "/userlist", NULL);
201 + tmp_path = g_strdup_printf("%s.%d.%ld", path, (int) getpid(), (long) time(NULL));
203 - fp = fopen(path, "w");
204 + fp = fopen(tmp_path, "w");
210 tmplist = tmplist->next;
213 + if (fclose(fp) == EOF) {
220 + if (rename(tmp_path, path) == -1) {
233 fp = fopen(path, "r");
235 g_warning("Cannot read config file. Using defaults.");
237 + if (! write_config()) {
238 + g_error("Cannot write new config file!");
244 @@ -467,10 +487,11 @@
257 @@ -479,13 +500,16 @@
258 config.height=window->allocation.height;
260 path = g_strconcat(config.homedir, "/config", NULL);
261 + tmp_path = g_strdup_printf("%s.%d.%ld", path, (int) getpid(), (long) time(NULL));
263 - fp = fopen(path, "w");
264 + fp = fopen(tmp_path, "w");
270 ("write_config(): Cannot write config file. Giving up.");
275 chmod(path, S_IRUSR | S_IWUSR);
277 fprintf(fp, "ignore %d\n", *(guint *) tmp_list->data);
278 tmp_list = tmp_list->next;
282 + if (fclose(fp) == EOF) {
289 + if (rename(tmp_path, path) == -1) {
301 /* na razie ma³o przdatne ;-) */
302 @@ -597,10 +636,16 @@
305 if (config.save_config_on_exit) {
307 + if (! write_config()) {
308 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
312 if (config.save_contacts_on_exit) {
314 + if (! write_contacts()) {
315 + show_error_dialog("Nie uda³o siê zapisaæ listy kontaktów!");
321 diff -ruN gg-1.0.0rel.orig/src/preferences.c gg-1.0.0rel/src/preferences.c
322 --- gg-1.0.0rel.orig/src/preferences.c 2002-11-27 17:52:02.000000000 +0100
323 +++ gg-1.0.0rel/src/preferences.c 2003-06-29 02:57:34.000000000 +0200
329 + if (! write_config())
330 + show_error_dialog("Nie uda³o siê zapisaæ konfiguracji!");
333 gtk_widget_destroy(dialog);
334 diff -ruN gg-1.0.0rel.orig/src/search.c gg-1.0.0rel/src/search.c
335 --- gg-1.0.0rel.orig/src/search.c 2003-02-16 21:09:03.000000000 +0100
336 +++ gg-1.0.0rel/src/search.c 2003-06-29 03:29:29.000000000 +0200
339 gtk_clist_clear(GTK_CLIST(wyniki_lista));
340 if (wyniki_kontakty) {
342 + GList *tmplist = wyniki_kontakty;
344 GGContact *k = tmplist->data;
346 diff -ruN gg-1.0.0rel.orig/src/search.h gg-1.0.0rel/src/search.h
347 --- gg-1.0.0rel.orig/src/search.h 2003-01-25 16:46:02.000000000 +0100
348 +++ gg-1.0.0rel/src/search.h 2003-06-29 03:24:43.000000000 +0200
350 guint gg_search50_next(gg_search50_t res);
351 guint32 gg_search50_seq(gg_search50_t res);
352 void gg_search50_free(gg_search50_t res);
353 -int gg_search50_handle_reply(gg_search50_t res, const char *packet, int length);
354 \ Brak znaku nowej linii na koñcu pliku
355 +int gg_search50_handle_reply(gg_search50_t res, const char *packet, int length);
356 diff -ruN gg-1.0.0rel.orig/src/sound-arts.cpp gg-1.0.0rel/src/sound-arts.cpp
357 --- gg-1.0.0rel.orig/src/sound-arts.cpp 2002-05-08 14:33:35.000000000 +0200
358 +++ gg-1.0.0rel/src/sound-arts.cpp 2003-06-29 03:29:44.000000000 +0200
360 return server.play(absolutePath(filename)) != 0;
364 +#endif /* HAVE_ARTS */
365 diff -ruN gg-1.0.0rel.orig/src/sound-arts.h gg-1.0.0rel/src/sound-arts.h
366 --- gg-1.0.0rel.orig/src/sound-arts.h 2002-05-08 14:33:35.000000000 +0200
367 +++ gg-1.0.0rel/src/sound-arts.h 2003-06-29 03:35:36.000000000 +0200
372 -#endif /* HAVE_ARTS */
373 \ Brak znaku nowej linii na koñcu pliku
374 +#endif /* HAVE_ARTS */