diff src/gtk/gtkui.c @ 879:a41a3590d696

2007-2-14 Brian Masney <masneyb@gftp.org> * lib/gftp.h src/gtk/gtkui.c src/uicommon/gftpui.c - added refreshing field to the gftp_request structure. If this is set in gftpui_common_cmd_open(), then the refresh command is not ran after a connection is made to the server. This field is currently only enabled when running called from the refresh function in the GTK+ port. It fixes an issue where the refresh command was being ran twice. (closes #171732)
author masneyb
date Thu, 15 Feb 2007 01:06:49 +0000
parents afbe37351940
children e999754d6106
line wrap: on
line diff
--- a/src/gtk/gtkui.c	Sun Feb 11 22:36:54 2007 +0000
+++ b/src/gtk/gtkui.c	Thu Feb 15 01:06:49 2007 +0000
@@ -46,22 +46,33 @@
 gftpui_refresh (void *uidata, int clear_cache_entry)
 {
   gftp_window_data * wdata;
+  int ret;
 
   wdata = uidata;
+  wdata->request->refreshing = 1;
+
   if (!check_status (_("Refresh"), wdata, 0, 0, 0, 1))
-    return;
+    {
+      wdata->request->refreshing = 0;
+      return;
+    }
 
   if (clear_cache_entry)
     gftp_delete_cache_entry (wdata->request, NULL, 0);
 
   if (check_reconnect (wdata) < 0)
-    return;
+    {
+      wdata->request->refreshing = 0;
+      return;
+    }
 
   gtk_clist_freeze (GTK_CLIST (wdata->listbox));
   remove_files_window (wdata);
 
   ftp_list_files (wdata);
   gtk_clist_thaw (GTK_CLIST (wdata->listbox));
+
+  wdata->request->refreshing = 0;
 }