[Goodies-commits] r5498 - xfbib/branches/gobject/src

Jesper Karlsson zarper at xfce.org
Wed Oct 1 18:02:30 CEST 2008


Author: zarper
Date: 2008-10-01 16:02:29 +0000 (Wed, 01 Oct 2008)
New Revision: 5498

Modified:
   xfbib/branches/gobject/src/xfbib-entry-edit-dialog.c
   xfbib/branches/gobject/src/xfbib-multiple-input.c
Log:
Fixed problem when only the last author/editor was added to the list when editing an entry.


Modified: xfbib/branches/gobject/src/xfbib-entry-edit-dialog.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-entry-edit-dialog.c	2008-10-01 15:34:47 UTC (rev 5497)
+++ xfbib/branches/gobject/src/xfbib-entry-edit-dialog.c	2008-10-01 16:02:29 UTC (rev 5498)
@@ -126,7 +126,6 @@
 		xfbib_strbuf_append(strbuf, tmp);
 	}
 
-	/* TODO: Fix this line, bad coding style */
 	xfbib_strbuf_append(strbuf, (xfbib_single_input_get_entry_text(XFBIB_SINGLE_INPUT (XFBIB_ENTRY_EDIT_DIALOG (user_data)->inputs[XFBIB_FIELD_YEAR])) + 2));
 
 	title = xfbib_single_input_get_entry_text(XFBIB_SINGLE_INPUT (XFBIB_ENTRY_EDIT_DIALOG (user_data)->inputs[XFBIB_FIELD_TITLE]));
@@ -315,18 +314,15 @@
 
 		gtk_entry_set_text(GTK_ENTRY (entry_edit_dialog->key_entry), xfbib_strbuf_get_str(xfbib_entry_get_key(entry)));
 
-
 		for (n = 0; n < XFBIB_FIELD_N_FIELDS; n++) {
+			field = xfbib_entry_get_field_by_column(entry, n);
+			if (field == NULL) {
+				continue;
+			}
 			if (n == XFBIB_FIELD_AUTHOR || n == XFBIB_FIELD_EDITOR) {
-				field = xfbib_entry_get_field_by_column(XFBIB_ENTRY(entry), n);
-				if (field == NULL)
-					continue;
 				xfbib_multiple_input_set_text (XFBIB_MULTIPLE_INPUT (entry_edit_dialog->inputs[n]),
 						xfbib_field_get_value_str(field));
 			} else {
-				field = xfbib_entry_get_field_by_column(XFBIB_ENTRY(entry), n);
-				if (field == NULL)
-					continue;
 				xfbib_single_input_set_entry_text (XFBIB_SINGLE_INPUT (entry_edit_dialog->inputs[n]),
 						xfbib_field_get_value_str(field));
 			}

Modified: xfbib/branches/gobject/src/xfbib-multiple-input.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-multiple-input.c	2008-10-01 15:34:47 UTC (rev 5497)
+++ xfbib/branches/gobject/src/xfbib-multiple-input.c	2008-10-01 16:02:29 UTC (rev 5498)
@@ -222,10 +222,10 @@
 	gint n;
 
 	model = gtk_tree_view_get_model(GTK_TREE_VIEW (multiple_input->tree_view));
-	gtk_list_store_append(GTK_LIST_STORE (model), &iter);
 	
 	split = g_strsplit(text, " and ", 0);
 	for (n = 0; split[n] != NULL; n++) {
+		gtk_list_store_append(GTK_LIST_STORE (model), &iter);
 		gtk_list_store_set(GTK_LIST_STORE (model), &iter, 0, split[n], -1);
 	}
 }




More information about the Goodies-commits mailing list