changeset 912:1f9c6baa458c

2007-4-18 Brian Masney <masneyb@gftp.org> * src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/gftp-gtk.h - added new function gftp_gtk_init_request(). It will initialize a gftp_request structure inside the gftp_window_data structure. * src/gtk/gtkui.c (gftpui_disconnect) - completely free the gftp_request structure when the user disconnects from the site.
author masneyb
date Wed, 18 Apr 2007 23:38:55 +0000
parents e0d98c63614d
children fad1aee65258
files ChangeLog src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/gtkui.c
diffstat 4 files changed, 25 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 18 23:34:01 2007 +0000
+++ b/ChangeLog	Wed Apr 18 23:38:55 2007 +0000
@@ -1,4 +1,11 @@
 2007-4-18 Brian Masney <masneyb@gftp.org>
+	* src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/gftp-gtk.h - added new
+	function gftp_gtk_init_request(). It will initialize a gftp_request
+	structure inside the gftp_window_data structure.
+
+	* src/gtk/gtkui.c (gftpui_disconnect) - completely free the gftp_request
+	structure when the user disconnects from the site.
+
 	* lib/local.c (local_mkdir) - return a successful response if errno is
 	set to EEXIST.
 
--- a/src/gtk/gftp-gtk.c	Wed Apr 18 23:34:01 2007 +0000
+++ b/src/gtk/gftp-gtk.c	Wed Apr 18 23:38:55 2007 +0000
@@ -762,6 +762,16 @@
 }
 
 
+void
+gftp_gtk_init_request (gftp_window_data * wdata)
+{
+  wdata->request = gftp_request_new ();
+  wdata->request->logging_function = ftp_log;
+  wdata->filespec = g_malloc0 (2);
+  *wdata->filespec = '*';
+}
+
+
 static GtkWidget *
 CreateFTPWindow (gftp_window_data * wdata)
 {
@@ -782,10 +792,7 @@
   titles[5] = _("Date");
   titles[6] = _("Attribs");
 
-  wdata->request = gftp_request_new ();
-  wdata->request->logging_function = ftp_log;
-  wdata->filespec = g_malloc0 (2);
-  *wdata->filespec = '*';
+  gftp_gtk_init_request (wdata);
 
   parent = gtk_frame_new (NULL);
   
--- a/src/gtk/gftp-gtk.h	Wed Apr 18 23:34:01 2007 +0000
+++ b/src/gtk/gftp-gtk.h	Wed Apr 18 23:38:55 2007 +0000
@@ -238,6 +238,8 @@
 						  gpointer data );
 
 /* gftp-gtk.c */
+void gftp_gtk_init_request 			( gftp_window_data * wdata );
+
 void toolbar_hostedit 				( GtkWidget * widget, 
 						  gpointer data );
 
--- a/src/gtk/gtkui.c	Wed Apr 18 23:34:01 2007 +0000
+++ b/src/gtk/gtkui.c	Wed Apr 18 23:38:55 2007 +0000
@@ -472,6 +472,11 @@
   gftp_delete_cache_entry (wdata->request, NULL, 1);
   gftp_disconnect (wdata->request);
   remove_files_window (wdata);
+
+  /* Free the request structure so that all old settings are purged. */
+  gftp_request_destroy (wdata->request, 1);
+  gftp_gtk_init_request (wdata);
+
   update_window_info ();
 }