Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24297/src
Modified Files:
fileselection.c
Log Message:
* fileselection.c: did not properly clean up after closing
the dirbrowser window with the window-close button.
Index: fileselection.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/fileselection.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fileselection.c 4 Dec 2005 10:24:38 -0000 1.4
+++ fileselection.c 5 Mar 2006 09:28:58 -0000 1.5
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-12-04 17:02:33 jcs>
+/* Time-stamp: <2006-03-05 18:25:08 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users.sourceforge.net>
| Part of the gtkpod project.
@@ -495,18 +495,28 @@
gtk_widget_show (dirbrowser);
}
+/* called when dirbrowser gets destroyed with the window-close button */
+static void dirbrowser_destroyed (GtkWidget *w, gpointer userdata)
+{
+ g_return_if_fail (dirbrowser);
+
+ dirbrowser = NULL;
+}
+
+
/* called when the file selector is closed */
static void add_dir_close (GtkWidget *w1, GtkWidget *w2)
{
- if (dirbrowser)
- {
- gint x,y;
- gtk_window_get_size (GTK_WINDOW (dirbrowser), &x, &y);
- /* stor size for next time */
- prefs_set_size_dirbr (x, y);
- gtk_widget_destroy(dirbrowser);
- dirbrowser = NULL;
- }
+ gint x,y;
+
+ g_return_if_fail (dirbrowser);
+
+ gtk_window_get_size (GTK_WINDOW (dirbrowser), &x, &y);
+ /* store size for next time */
+ prefs_set_size_dirbr (x, y);
+ gtk_widget_destroy(dirbrowser);
+ /* dirbrowser = NULL; -- will be done by the dirbrowser_destroy()
+ as part of the callback */
}
@@ -763,6 +773,10 @@
GTK_OBJECT(window));
gtk_widget_show(cancel);
+ gtk_signal_connect(GTK_OBJECT(window), "destroy",
+ GTK_SIGNAL_FUNC(dirbrowser_destroyed),
+ NULL);
+
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
gtk_widget_show(bbox);
gtk_widget_show(vbox);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2