changeset 773:942dd9c2a064

2006-7-19 Brian Masney <masneyb@gftp.org> * src/gtk/gftp-gtk.c - fixed the default protocol dropdown when some protocols are disabled (from Aurelien Jarno <aurelien@aurel32.net>) (closes #312724)
author masneyb
date Thu, 20 Jul 2006 02:16:30 +0000
parents 9a6477042520
children 2adc6b8b3197
files ChangeLog src/gtk/gftp-gtk.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 20 01:54:39 2006 +0000
+++ b/ChangeLog	Thu Jul 20 02:16:30 2006 +0000
@@ -1,4 +1,8 @@
 2006-7-19 Brian Masney <masneyb@gftp.org>
+	* src/gtk/gftp-gtk.c - fixed the default protocol dropdown when some
+	protocols are disabled (from Aurelien Jarno <aurelien@aurel32.net>)
+	(closes #312724)
+
 	* src/gtk/bookmarks.c - fixed segfault in the bookmarks editor (from
 	Grant Hammond <grant@f1fox.net>) (closes #329261 and #169617)
 
@@ -3428,7 +3432,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.444 2006/07/20 01:54:39 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.445 2006/07/20 02:16:29 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/src/gtk/gftp-gtk.c	Thu Jul 20 01:54:39 2006 +0000
+++ b/src/gtk/gftp-gtk.c	Thu Jul 20 02:16:30 2006 +0000
@@ -432,7 +432,7 @@
   GtkWidget *toolbar, *box, *tempwid;
   gftp_config_list_vars * tmplistvar;
   char *default_protocol, *tempstr;
-  int i, num;
+  int i, j, num;
 
   toolbar = gtk_handle_box_new ();
 
@@ -551,14 +551,16 @@
   num = 0;
   gftp_lookup_global_option ("default_protocol", &default_protocol);
   protocol_menu = gtk_menu_new ();
-  for (i = 0; gftp_protocols[i].name; i++)
+  for (i = 0, j = 0; gftp_protocols[i].name; i++)
     {
       if (!gftp_protocols[i].shown)
         continue;
 
       if (default_protocol != NULL &&
           strcmp (gftp_protocols[i].name, default_protocol) == 0)
-        num = i;
+        num = j;
+ 
+      j++;
 
       tempwid = gtk_menu_item_new_with_label (gftp_protocols[i].name);
       gtk_object_set_user_data (GTK_OBJECT (tempwid), GINT_TO_POINTER(i));