changeset 514:e55d8b35d809

2004-7-25 Brian Masney <masneyb@gftp.org> * src/gtk/bookmarks.c src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/transfer.c src/text/textui.c src/uicommon/gftpui.c src/uicommon/gftpui.h - added clear_cache argument to gftpui_refresh() Don't clear the cache when changing directories * src/uicommon/gftpuicallbacks.c (_gftpui_common_rm_list) - return 0 on success * src/gtk/delete_dialog.c - refresh the directory listing after the operation was successful
author masneyb
date Sun, 25 Jul 2004 15:48:25 +0000
parents cb882efd4d6d
children cb78cf311d23
files ChangeLog src/gtk/bookmarks.c src/gtk/delete_dialog.c src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/transfer.c src/text/textui.c src/uicommon/gftpui.c src/uicommon/gftpui.h src/uicommon/gftpuicallbacks.c
diffstat 10 files changed, 41 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jul 25 15:24:37 2004 +0000
+++ b/ChangeLog	Sun Jul 25 15:48:25 2004 +0000
@@ -1,4 +1,15 @@
 2004-7-25 Brian Masney <masneyb@gftp.org>
+	* src/gtk/bookmarks.c src/gtk/gftp-gtk.c src/gtk/gtkui.c
+	src/gtk/transfer.c src/text/textui.c src/uicommon/gftpui.c 
+	src/uicommon/gftpui.h - added clear_cache argument to gftpui_refresh()
+	Don't clear the cache when changing directories
+
+	* src/uicommon/gftpuicallbacks.c (_gftpui_common_rm_list) - return
+	0 on success
+
+	* src/gtk/delete_dialog.c - refresh the directory listing after the
+	operation was successful
+
 	* lib/rfc959.c - added rfc959_set_file_time(). This uses the SITE UTIME
 	command. Not many FTP servers appear to support this extension
 
@@ -2624,7 +2635,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.291 2004/07/25 15:24:37 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.292 2004/07/25 15:48:25 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/bookmarks.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/gtk/bookmarks.c	Sun Jul 25 15:48:25 2004 +0000
@@ -50,7 +50,7 @@
     return;
 
   if (refresh_local)
-    gftpui_refresh (other_wdata);
+    gftpui_refresh (other_wdata, 0);
 
   ftp_connect (current_wdata, current_wdata->request, 1);
 }
--- a/src/gtk/delete_dialog.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/gtk/delete_dialog.c	Sun Jul 25 15:48:25 2004 +0000
@@ -36,7 +36,6 @@
   cdata->files = transfer->files;
   cdata->uidata = wdata;
   cdata->run_function = gftpui_common_run_delete;
-  cdata->dont_refresh = 1;
 
   gftpui_common_run_callback_function (cdata);
 
--- a/src/gtk/gftp-gtk.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/gtk/gftp-gtk.c	Sun Jul 25 15:48:25 2004 +0000
@@ -214,6 +214,13 @@
 }
 
 
+static void
+gftp_gtk_refresh (gftp_window_data * wdata)
+{
+  gftpui_refresh (wdata, 1);
+}
+
+
 static GtkWidget *
 CreateMenus (GtkWidget * parent)
 {
@@ -258,7 +265,7 @@
     {N_("/Local/Delete..."), NULL, delete_dialog, 0, MN_(NULL)},
     {N_("/Local/Edit..."), NULL, edit_dialog, 0, MN_(NULL)},
     {N_("/Local/View..."), NULL, view_dialog, 0, MN_(NULL)},
-    {N_("/Local/Refresh"), NULL, gftpui_refresh, 0, MS_(GTK_STOCK_REFRESH)},
+    {N_("/Local/Refresh"), NULL, gftp_gtk_refresh, 0, MS_(GTK_STOCK_REFRESH)},
     {N_("/_Remote"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Remote/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
     {N_("/Remote/Open _URL..."), "<control>U", openurl_dialog, 0,
@@ -281,7 +288,7 @@
     {N_("/Remote/Delete..."), NULL, delete_dialog, 0, MN_(NULL)},
     {N_("/Remote/Edit..."), NULL, edit_dialog, 0, MN_(NULL)},
     {N_("/Remote/View..."), NULL, view_dialog, 0, MN_(NULL)},
-    {N_("/Remote/Refresh"), NULL, gftpui_refresh, 0, MS_(GTK_STOCK_REFRESH)},
+    {N_("/Remote/Refresh"), NULL, gftp_gtk_refresh, 0, MS_(GTK_STOCK_REFRESH)},
     {N_("/_Bookmarks"), NULL, 0, 0, MN_("<Branch>")},
     {N_("/Bookmarks/tearoff"), NULL, 0, 0, MN_("<Tearoff>")},
     {N_("/Bookmarks/Add bookmark"), "<control>A", add_bookmark, 0,
--- a/src/gtk/gtkui.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/gtk/gtkui.c	Sun Jul 25 15:48:25 2004 +0000
@@ -43,7 +43,7 @@
 
 
 void
-gftpui_refresh (void *uidata)
+gftpui_refresh (void *uidata, int clear_cache)
 {
   gftp_window_data * wdata;
 
@@ -56,7 +56,10 @@
 
   gtk_clist_freeze (GTK_CLIST (wdata->listbox));
   remove_files_window (wdata);
-  gftp_delete_cache_entry (wdata->request, NULL, 0);
+
+  if (clear_cache)
+    gftp_delete_cache_entry (wdata->request, NULL, 0);
+
   ftp_list_files (wdata);
   gtk_clist_thaw (GTK_CLIST (wdata->listbox));
 }
@@ -392,6 +395,7 @@
   cdata->uidata = wdata;
   cdata->run_function = gftpui_common_run_chdir;
   cdata->input_string = tempstr;
+  cdata->dont_clear_cache = 1;
 
   ret = gftpui_common_run_callback_function (cdata);
 
--- a/src/gtk/transfer.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/gtk/transfer.c	Sun Jul 25 15:48:25 2004 +0000
@@ -442,7 +442,7 @@
   if (refresh_files && tdata->curfle && tdata->curfle->next &&
       compare_request (tdata->toreq, 
                        ((gftp_window_data *) tdata->towdata)->request, 1))
-    gftpui_refresh (tdata->towdata);
+    gftpui_refresh (tdata->towdata, 1);
 }
 
 
@@ -594,7 +594,7 @@
 
       if (tdata->towdata != NULL && compare_request (tdata->toreq,
                            ((gftp_window_data *) tdata->towdata)->request, 1))
-        gftpui_refresh (tdata->towdata);
+        gftpui_refresh (tdata->towdata, 1);
 
       num_transfers_in_progress--;
     }
--- a/src/text/textui.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/text/textui.c	Sun Jul 25 15:48:25 2004 +0000
@@ -40,12 +40,14 @@
 
 
 void
-gftpui_refresh (void *uidata)
+gftpui_refresh (void *uidata, int clear_cache)
 {
   gftp_request * request;
 
   request = uidata; /* Note: uidata is set to the request in gftp_text.c */
-  gftp_delete_cache_entry (request, NULL, 0);
+
+  if (clear_cache)
+    gftp_delete_cache_entry (request, NULL, 0);
 }
 
 
--- a/src/uicommon/gftpui.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/uicommon/gftpui.c	Sun Jul 25 15:48:25 2004 +0000
@@ -122,7 +122,7 @@
     ret = GPOINTER_TO_INT (cdata->run_function (cdata));
 
   if (ret == 0 && !cdata->dont_refresh)
-    gftpui_refresh (cdata->uidata);
+    gftpui_refresh (cdata->uidata, !cdata->dont_clear_cache);
 
   return (ret == 0);
 }
@@ -493,6 +493,7 @@
   cdata->uidata = uidata;
   cdata->input_string = newdir != NULL ? newdir : (char *) command;
   cdata->run_function = gftpui_common_run_chdir;
+  cdata->dont_clear_cache = 1;
 
   gftpui_common_run_callback_function (cdata);
 
--- a/src/uicommon/gftpui.h	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/uicommon/gftpui.h	Sun Jul 25 15:48:25 2004 +0000
@@ -39,7 +39,8 @@
   int (*connect_function) (gftpui_callback_data * cdata);
   void (*disconnect_function) (gftpui_callback_data * cdata);
   unsigned int dont_check_connection : 1,
-               dont_refresh : 1;
+               dont_refresh : 1,
+               dont_clear_cache : 1;
 };
 
 
@@ -159,7 +160,8 @@
 
 int gftpui_check_reconnect		( gftpui_callback_data * cdata );
 
-void gftpui_refresh 			( void *uidata );
+void gftpui_refresh 			( void *uidata,
+					  int clear_cache );
 
 void *gftpui_generic_thread 		( void *(*run_function)(void *data),
 					  void *data);
--- a/src/uicommon/gftpuicallbacks.c	Sun Jul 25 15:24:37 2004 +0000
+++ b/src/uicommon/gftpuicallbacks.c	Sun Jul 25 15:48:25 2004 +0000
@@ -160,7 +160,7 @@
   else
     rmhash = NULL;
 
-  ret = 1;
+  ret = 0;
   for (; templist != NULL; templist = templist->prev)
     { 
       tempfle = templist->data;