support logging of qofchoice by default

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13115 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Neil Williams 2006-02-05 10:58:13 +00:00
parent 9a66ebdf0b
commit bd4211ad2e
3 changed files with 7 additions and 2 deletions

View File

@ -22,8 +22,10 @@
*/
#include <glib.h>
#include "qof.h"
#include "qofchoice.h"
static QofLogModule log_module = QOF_MOD_CHOICE;
static GHashTable *qof_choice_table = NULL;
/* To initialise, call qof_choice_add_class in
@ -44,11 +46,11 @@ gboolean qof_object_is_choice(QofIdType type)
value = NULL;
check = NULL;
g_return_val_if_fail(qof_choice_is_initialized(), FALSE);
if(!qof_choice_is_initialized()) { return FALSE; }
g_return_val_if_fail(type != NULL, FALSE);
value = g_hash_table_lookup(qof_choice_table, type);
if((GHashTable*)value) { return TRUE; }
g_message("DEBUG: QOF_TYPE_CHOICE setup failed for %s\n", type);
DEBUG (" QOF_TYPE_CHOICE setup failed for %s\n", type);
return FALSE;
}

View File

@ -93,6 +93,8 @@ the object must return a single entity matching one of the choice types.
#include "qofclass.h"
#include "qofobject.h"
#define QOF_MOD_CHOICE "qof-choice"
/** \brief Identify an object as containing a choice. */
#define QOF_TYPE_CHOICE "choice"

View File

@ -327,6 +327,7 @@ void qof_log_set_default(QofLogLevel log_level)
qof_log_set_level(QOF_MOD_MERGE, log_level);
qof_log_set_level(QOF_MOD_QUERY, log_level);
qof_log_set_level(QOF_MOD_SESSION, log_level);
qof_log_set_level(QOF_MOD_CHOICE, log_level);
}
struct hash_s