[balsa/gtk3] Reduce scope of variables



commit f87396c53b53ee84925dd98240acff2d9db45484
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jul 22 16:05:42 2012 -0400

    Reduce scope of variables
    
    	* src/store-address.c (store_address_book_frame): reduce scope
    	of variables.

 ChangeLog           |    5 +++++
 src/store-address.c |   16 ++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6422405..8d12e64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-07-22  Peter Bloomfield
 
+	* src/store-address.c (store_address_book_frame): reduce scope
+	of variables.
+
+2012-07-22  Peter Bloomfield
+
 	* src/sendmsg-window.c (update_bsmsg_identity): reduce scope of
 	variables;
 	(tree_add_quote_body): suppress null pointer warning.
diff --git a/src/store-address.c b/src/store-address.c
index 769a8f1..235532d 100644
--- a/src/store-address.c
+++ b/src/store-address.c
@@ -276,24 +276,26 @@ store_address_from_entries(GtkWindow *window, StoreAddressInfo * info,
 static GtkWidget *
 store_address_book_frame(StoreAddressInfo * info)
 {
-    GList *ab_list;
-    GtkWidget *frame = gtk_frame_new(_("Choose Address Book"));
+    GtkWidget *frame;
     GtkWidget *combo_box;
-    LibBalsaAddressBook *address_book;
-    guint default_ab_offset = 0, off;
 
     combo_box = gtk_combo_box_text_new();
     g_signal_connect(combo_box, "changed",
                      G_CALLBACK(store_address_book_menu_cb), info);
     if (balsa_app.address_book_list) {
+        guint default_ab_offset = 0, off;
+        GList *ab_list;
+
 	info->current_address_book = balsa_app.default_address_book;
 
 	/* NOTE: we have to store the default address book index and
            call set_active() after all books are added to the list or
            gtk-2.10.4 will lose the setting. */
 	for(off=0, ab_list = balsa_app.address_book_list;
-            ab_list; 
-            off++, ab_list = g_list_next(ab_list)) {
+            ab_list;
+            off++, ab_list = ab_list->next) {
+            LibBalsaAddressBook *address_book;
+
 	    address_book = LIBBALSA_ADDRESS_BOOK(ab_list->data);
 	    if (info->current_address_book == NULL)
 		info->current_address_book = address_book;
@@ -306,6 +308,8 @@ store_address_book_frame(StoreAddressInfo * info)
         gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box),
                                  default_ab_offset);
     }
+
+    frame = gtk_frame_new(_("Choose Address Book"));
     gtk_container_add(GTK_CONTAINER(frame), combo_box);
 
     return frame;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]