Another QIF-import fix

Derek Atkins warlord@MIT.EDU
19 Feb 2001 10:46:05 -0500


If you import a QIF and:

	a) the importer can't disamiguate the date, and
	b) the QIF didn't contain a default-account,

The importer fails to even guess the default account.  The following
patch fixes this problem.

-derek

--- src/gnome/druid-qif-import.c~	Fri Feb 16 20:13:22 2001
+++ src/gnome/druid-qif-import.c	Mon Feb 19 10:22:17 2001
@@ -705,6 +710,16 @@
   gh_call2(reparse_dates, wind->selected_file, format_sym);
   
   if(gh_call1(check_from_acct, wind->selected_file) != SCM_BOOL_T) {
+    SCM default_acct    = gh_eval_str("qif-file:path-to-accountname");
+    char * default_acctname;
+
+    default_acctname = gh_scm2newstr(gh_call1(default_acct,
+					      wind->selected_file),
+				     NULL);
+    gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
+
+    if(default_acctname) free(default_acctname);
+
     return FALSE;
   }
   else {


-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available