[Gnucash-changes] r13687 - gnucash/trunk - Store the log level of all printed messages and use this as

Christian Stimming cstim at cvs.gnucash.org
Thu Mar 23 07:12:50 EST 2006


Author: cstim
Date: 2006-03-23 07:12:48 -0500 (Thu, 23 Mar 2006)
New Revision: 13687
Trac: http://svn.gnucash.org/trac/changeset/13687

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
   gnucash/trunk/src/import-export/hbci/hbci-interaction.c
   gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
Log:
Store the log level of all printed messages and use this as 
yet another check whether aqbanking had any errors.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-23 05:41:29 UTC (rev 13686)
+++ gnucash/trunk/ChangeLog	2006-03-23 12:12:48 UTC (rev 13687)
@@ -1,3 +1,9 @@
+2006-03-23  Christian Stimming <stimming at tuhh.de>
+
+	* src/import-export/hbci/hbci-interaction.c: Store the log level
+	of all printed messages and use this as yet another check whether
+	aqbanking had any errors.
+
 2006-03-22  David Hampton  <hampton at employees.org>
 
 	* accounts/*/acctchrt_common.gnucash-xea: Mark all common account

Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c	2006-03-23 05:41:29 UTC (rev 13686)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c	2006-03-23 12:12:48 UTC (rev 13687)
@@ -453,7 +453,7 @@
   }
 
   GNCInteractor_set_cache_valid (inter, TRUE);
-  if (resultcode <= 20) {
+  if (resultcode <= 20 && (! GNCInteractor_hadErrors(inter)) ) {
     return TRUE;
   }
   else {

Modified: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2006-03-23 05:41:29 UTC (rev 13686)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2006-03-23 12:12:48 UTC (rev 13687)
@@ -67,6 +67,7 @@
     gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
   data->showbox_id = 1;
   data->showbox_hash = g_hash_table_new(NULL, NULL); 
+  data->min_loglevel = AB_Banking_LogLevelVerbous;
 
   /* set HBCI_Interactor */
   gnc_hbci_add_callbacks(api, data);
@@ -215,7 +216,8 @@
 gboolean GNCInteractor_hadErrors (const GNCInteractor *i)
 {
   g_assert (i);
-  return i->msgBoxError != 0;
+  return (i->msgBoxError != 0) ||
+    (i->min_loglevel < AB_Banking_LogLevelNotice);
 }
 
 /* ************************************************************ 
@@ -652,6 +654,9 @@
   /* Show the dialog */
   GNCInteractor_show(data);
 
+  /* Initialize loglevel caching */
+  data->min_loglevel = AB_Banking_LogLevelVerbous;
+
   g_free(title);
   g_free(text);
   return progress_id;
@@ -701,6 +706,10 @@
   /* printf("progressLogCB: Logging msg: %s\n", text); */
   GNCInteractor_add_log_text (data, text);
 
+  /* Cache loglevel */
+  if (level < data->min_loglevel)
+    data->min_loglevel = level;
+
   g_free(text);
   return !keepAlive(data);
 }

Modified: gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interactionP.h	2006-03-23 05:41:29 UTC (rev 13686)
+++ gnucash/trunk/src/import-export/hbci/hbci-interactionP.h	2006-03-23 12:12:48 UTC (rev 13687)
@@ -77,6 +77,9 @@
 
   /* Flag whether the last dialog showed any error */
   gboolean msgBoxError;
+  /* Cache the lowest loglevel, corresponding to the most serious
+     warning. */
+  AB_BANKING_LOGLEVEL min_loglevel;
 };
 
 void delete_GNCInteractor (GNCInteractor *data);



More information about the gnucash-changes mailing list