diff src/gtk/transfer.c @ 894:14476a8a4d2b

2007-3-15 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c src/gtk/view_dialog.c - combined some duplicate code that was used to view and edit files. * lib/gftp.h src/gtk/transfer.c src/gtk/view_dialog.c src/uicommon/gftpui.c - removed is_fd member from the gftp_file structure.
author masneyb
date Fri, 16 Mar 2007 02:33:05 +0000
parents 1808cebed602
children 19b6d55e2646
line wrap: on
line diff
--- a/src/gtk/transfer.c	Fri Mar 16 01:23:46 2007 +0000
+++ b/src/gtk/transfer.c	Fri Mar 16 02:33:05 2007 +0000
@@ -404,7 +404,6 @@
       if (ve_proc->pid != pid)
         continue;
 
-printf ("Found pid %d in the linked list\n", pid);
       deldata = curdata;
       curdata = curdata->next;
 
@@ -450,7 +449,6 @@
 static void
 on_next_transfer (gftp_transfer * tdata)
 {
-  int fd;
   intptr_t refresh_files;
   gftp_file * tempfle;
 
@@ -459,33 +457,12 @@
     {
       tempfle = tdata->updfle->data;
 
-      if (tempfle->is_fd)
-        fd = tempfle->fd;
-      else
-        fd = 0;
-
-      if (tempfle->done_view)
+      if (tempfle->done_view || tempfle->done_edit)
         {
           if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP)
-            view_file (tempfle->destfile, fd, 1, tempfle->done_rm, 1, 0,
-                       tempfle->file, NULL);
-
-          if (tempfle->is_fd)
             {
-              close (tempfle->fd);
-              tempfle->fd = -1;
-            }
-        }
-      else if (tempfle->done_edit)
-        {
-          if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP)
-	    view_file (tempfle->destfile, fd, 0, tempfle->done_rm, 1, 0,
-                       tempfle->file, NULL);
-
-          if (tempfle->is_fd)
-            {
-              close (tempfle->fd);
-              tempfle->fd = -1;
+              view_file (tempfle->destfile, 0, tempfle->done_view,
+                         tempfle->done_rm, 1, 0, tempfle->file, NULL);
             }
         }
       else if (tempfle->done_rm)