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>
* 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
using the import-main-matcher.

View File

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

View File

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