changeset 275:5810b0f97eee

2003-9-21 Brian Masney <masneyb@gftp.org> * lib/protocols.c (gftp_parse_bookmark) lib/gftp.h lib/bookmark.c src/gtk/bookmarks.c - added pointer to refresh_local variable that is enabled if the local directory was changed. In src/gtk/bookmarks.c, if the local directory was changed, refresh the directory listing.
author masneyb
date Sun, 21 Sep 2003 17:33:45 +0000
parents 4610d25d4abb
children 70d0c9a2e424
files ChangeLog lib/bookmark.c lib/gftp.h lib/protocols.c src/gtk/bookmarks.c
diffstat 5 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Sep 21 16:50:49 2003 +0000
+++ b/ChangeLog	Sun Sep 21 17:33:45 2003 +0000
@@ -1,4 +1,9 @@
 2003-9-21 Brian Masney <masneyb@gftp.org>
+	* lib/protocols.c (gftp_parse_bookmark) lib/gftp.h lib/bookmark.c 
+	src/gtk/bookmarks.c - added pointer to refresh_local variable that is
+	enabled if the local directory was changed. In src/gtk/bookmarks.c, if
+	the local directory was changed, refresh the directory listing.
+
 	* lib/local.c src/gtk/transfer.c src/text/gftp-text.c - if there is a
 	dangling symlink in the current directory, don't bail out. This was 
 	causing directory listings to appear truncated.
@@ -1507,7 +1512,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.139 2003/09/21 16:50:47 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.140 2003/09/21 17:33:44 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/bookmark.c	Sun Sep 21 16:50:49 2003 +0000
+++ b/lib/bookmark.c	Sun Sep 21 17:33:45 2003 +0000
@@ -25,6 +25,7 @@
 bookmark_parse_url (gftp_request * request, const char * url)
 {
   const char * pos;
+  int update_local;
 
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
   g_return_val_if_fail (url != NULL, GFTP_EFATAL);
@@ -42,7 +43,7 @@
   else
     pos = url;
 
-  return (gftp_parse_bookmark (request, NULL, pos));
+  return (gftp_parse_bookmark (request, NULL, pos, &update_local));
 }
 
 
--- a/lib/gftp.h	Sun Sep 21 16:50:49 2003 +0000
+++ b/lib/gftp.h	Sun Sep 21 17:33:45 2003 +0000
@@ -816,7 +816,8 @@
 
 int gftp_parse_bookmark 		( gftp_request * request, 
 					  gftp_request * local_request,
-					  const char * bookmark );
+					  const char * bookmark,
+					  int *refresh_local );
 
 int gftp_parse_url 			( gftp_request * request, 
 					  const char *url );
--- a/lib/protocols.c	Sun Sep 21 16:50:49 2003 +0000
+++ b/lib/protocols.c	Sun Sep 21 17:33:45 2003 +0000
@@ -478,7 +478,7 @@
 
 int
 gftp_parse_bookmark (gftp_request * request, gftp_request * local_request, 
-                     const char * bookmark)
+                     const char * bookmark, int *refresh_local)
 {
   gftp_logging_func logging_function;
   gftp_bookmarks_var * tempentry;
@@ -523,7 +523,12 @@
   if (local_request != NULL &&
       tempentry->local_dir != NULL &&
       *tempentry->local_dir != '\0')
-    gftp_set_directory (local_request, tempentry->local_dir);
+    {
+      gftp_set_directory (local_request, tempentry->local_dir);
+      *refresh_local = 1;
+    }
+  else
+    *refresh_local = 0;
 
   for (i = 0; gftp_protocols[i].name; i++)
     {
--- a/src/gtk/bookmarks.c	Sun Sep 21 16:50:49 2003 +0000
+++ b/src/gtk/bookmarks.c	Sun Sep 21 17:33:45 2003 +0000
@@ -31,6 +31,8 @@
 void
 run_bookmark (gpointer data)
 {
+  int refresh_local;
+
   if (window1.request->stopable || window2.request->stopable)
     {
       ftp_log (gftp_logging_misc, NULL,
@@ -40,9 +42,12 @@
     }
 
   if (gftp_parse_bookmark (current_wdata->request, other_wdata->request,
-                           (char *) data) < 0)
+                           (char *) data, &refresh_local) < 0)
     return;
 
+  if (refresh_local)
+    refresh (other_wdata);
+
   if (GFTP_IS_CONNECTED (current_wdata->request))
     disconnect (current_wdata);