X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=d11dfaf3dc7245b6b0f7988f5056144e318d8dd4;hb=ac7f84306474dbecea8f6fee2ef2e8d71cc950f7;hp=e4ef14e0c1ee7d7a748e9116de5a20a11e035860;hpb=567bcbc294b3aed632d18eb22056840292bdeb1e;p=obsolete%2Fnotmuch-old diff --git a/lib/database.cc b/lib/database.cc index e4ef14e0..d11dfaf3 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -26,6 +26,7 @@ #include #include /* g_free, GPtrArray, GHashTable */ +#include /* g_type_init */ using namespace std; @@ -80,13 +81,17 @@ typedef struct { * STRING is the name of a file within that * directory for this mail message. * - * A mail document also has two values: + * A mail document also has four values: * * TIMESTAMP: The time_t value corresponding to the message's * Date header. * * MESSAGE_ID: The unique ID of the mail mess (see "id" above) * + * FROM: The value of the "From" header + * + * SUBJECT: The value of the "Subject" header + * * In addition, terms from the content of the message are added with * "from", "to", "attachment", and "subject" prefixes for use by the * user in searching. Similarly, terms from the path of the mail @@ -600,6 +605,9 @@ notmuch_database_open (const char *path, goto DONE; } + /* Initialize the GLib type system and threads */ + g_type_init (); + notmuch = talloc (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); @@ -1443,7 +1451,7 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch, keys = g_hash_table_get_keys (parents); for (l = keys; l; l = l->next) { char *parent_message_id; - const char *parent_thread_id; + const char *parent_thread_id = NULL; parent_message_id = (char *) l->data;