2002-12-14 Christian Stimming <stimming@tuhh.de>

* src/import-export/import-backend.c (matchmap_store_destination):
	Fix error messages when memo or description is empty.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7683 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2002-12-14 13:17:54 +00:00
parent ef48c2edd5
commit a17b9305e7
3 changed files with 20 additions and 12 deletions

View File

@ -1,5 +1,8 @@
2002-12-14 Christian Stimming <stimming@tuhh.de> 2002-12-14 Christian Stimming <stimming@tuhh.de>
* src/import-export/import-backend.c (matchmap_store_destination):
Fix error messages when memo or description is empty.
* src/import-export/hbci/gnc-hbci-gettrans.c: Switch to always * src/import-export/hbci/gnc-hbci-gettrans.c: Switch to always
using the import-main-matcher. using the import-main-matcher.

View File

@ -364,6 +364,7 @@ matchmap_store_destination (GncImportMatchMap *matchmap,
{ {
GncImportMatchMap *tmp_matchmap = NULL; GncImportMatchMap *tmp_matchmap = NULL;
Account *dest; Account *dest;
char *descr, *memo;
g_assert (trans_info); g_assert (trans_info);
/* This will store the destination account of the selected match if /* This will store the destination account of the selected match if
@ -384,16 +385,20 @@ matchmap_store_destination (GncImportMatchMap *matchmap,
(xaccSplitGetAccount (xaccSplitGetAccount
(gnc_import_TransInfo_get_fsplit (trans_info)))); (gnc_import_TransInfo_get_fsplit (trans_info))));
gnc_imap_add_account (tmp_matchmap, descr = xaccTransGetDescription
GNCIMPORT_DESC, (gnc_import_TransInfo_get_trans (trans_info));
xaccTransGetDescription if (descr && (strlen (descr) > 0))
(gnc_import_TransInfo_get_trans (trans_info)), gnc_imap_add_account (tmp_matchmap,
dest); GNCIMPORT_DESC,
gnc_imap_add_account (tmp_matchmap, descr,
GNCIMPORT_MEMO, dest);
xaccSplitGetMemo memo = xaccSplitGetMemo
(gnc_import_TransInfo_get_fsplit (trans_info)), (gnc_import_TransInfo_get_fsplit (trans_info));
dest); if (memo && (strlen (memo) > 0))
gnc_imap_add_account (tmp_matchmap,
GNCIMPORT_MEMO,
memo,
dest);
if (matchmap == NULL) if (matchmap == NULL)
gnc_imap_destroy (tmp_matchmap); gnc_imap_destroy (tmp_matchmap);
@ -701,7 +706,7 @@ gnc_import_process_trans_clist (GtkCList *clist,
/* Erase the downloaded transaction */ /* Erase the downloaded transaction */
xaccTransDestroy(trans_info->trans); xaccTransDestroy(trans_info->trans);
DEBUG("CommitEdit trans") /*DEBUG("CommitEdit trans")*/
xaccTransCommitEdit(trans_info->trans); xaccTransCommitEdit(trans_info->trans);
} }
break; break;

View File

@ -127,7 +127,7 @@ void gnc_imap_add_account (GncImportMatchMap *imap, const char *category,
{ {
kvp_value *value; kvp_value *value;
if (!imap || !key || !acc) return; if (!imap || !key || !acc || (strlen (key) == 0)) return;
if (!category) { if (!category) {
category = key; category = key;
key = NULL; key = NULL;